git使用

https://blog.csdn.net/javafreely/article/details/18217273

1.git tag的使用https://blog.csdn.net/hustpzb/article/details/8056518
新建tag
$ git tag -a v3.1.17 -m 'my version 3.1.17'

git push --tags把所有的标签保存到远程库

2.tag合并到主线,分支创建合并https://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/001375840038939c291467cc7c747b1810aab2fb8863508000


EDZ@DESKTOP-2I3DKK8 MINGW64 /d/ganjie_bug/ganjie-android (master)
$ git checkout v3.1.15
Note: checking out 'v3.1.15'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 53b7a2b9 去掉店铺页向左退出的箭头

EDZ@DESKTOP-2I3DKK8 MINGW64 /d/ganjie_bug/ganjie-android ((v3.1.15))
$ git add .
warning: LF will be replaced by CRLF in .idea/gradle.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .idea/misc.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .idea/modules.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .idea/runConfigurations.xml.
The file will have its original line endings in your working directory.

EDZ@DESKTOP-2I3DKK8 MINGW64 /d/ganjie_bug/ganjie-android ((v3.1.15))
$ git commit -m "修改分享成为合伙人获取手机号取错字段"
[detached HEAD 5cd18e7f] 修改分享成为合伙人获取手机号取错字段
 11 files changed, 15 insertions(+), 4 deletions(-)
 create mode 100644 app/release/ganjie_20180807_v3.1.15.1_200058_release.apk
 create mode 100644 app/release/ganjie_20180807_v3.1.15_200057_release.apk

EDZ@DESKTOP-2I3DKK8 MINGW64 /d/ganjie_bug/ganjie-android ((5cd18e7f...))
$ git checkout master
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  5cd18e7f 修改分享成为合伙人获取手机号取错字段

If you want to keep it by creating a new branch, this may be a good time
to do so with:

 git branch <new-branch-name> 5cd18e7f

Switched to branch 'master'
Your branch is up to date with 'origin/master'.

EDZ@DESKTOP-2I3DKK8 MINGW64 /d/ganjie_bug/ganjie-android (master)
$ git merge ^C

EDZ@DESKTOP-2I3DKK8 MINGW64 /d/ganjie_bug/ganjie-android (master)
$ git merge 5cd18e7f
Auto-merging app/src/main/java/com/ganjie/app/personal/LoginAppActivity.java
CONFLICT (content): Merge conflict in app/src/main/java/com/ganjie/app/personal/LoginAppActivity.java
Automatic merge failed; fix conflicts and then commit the result.

EDZ@DESKTOP-2I3DKK8 MINGW64 /d/ganjie_bug/ganjie-android (master|MERGING)
$ git add .

EDZ@DESKTOP-2I3DKK8 MINGW64 /d/ganjie_bug/ganjie-android (master|MERGING)
$ git commit -m "合并bug修复"
[master 4f58b035] 合并bug修复

EDZ@DESKTOP-2I3DKK8 MINGW64 /d/ganjie_bug/ganjie-android (master)
$ git push
Counting objects: 33, done.
Delta compression using up to 6 threads.
Compressing objects: 100% (27/27), done.
Writing objects: 100% (33/33), 29.11 MiB | 2.39 MiB/s, done.
Total 33 (delta 22), reused 0 (delta 0)
To dev.51ganjie.cn:ganjie-hz-dev/ganjie-android.git
   d5989126..4f58b035  master -> master

EDZ@DESKTOP-2I3DKK8 MINGW64 /d/ganjie_bug/ganjie-android (master)
$

经验:最好创建分支再改,因为代码中可能存在多个bug,下一次再拉tag的时候之前修改的bug就还要重新再写一遍。

git 代码push遇到的错误
https://www.cnblogs.com/wei325/p/5278922.html

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 一、电脑本地初始化一个仓库 1. git init: 初始化一个电脑上本地仓库 终端进入项目目录,输入: 该命令将...
    dragon_li阅读 3,000评论 1 4
  • 本文通过以下四个部分讲解git的使用 Git配置 Git使用场景 Git分支管理方法 常用git命令 在讲解...
    z小牛阅读 1,697评论 0 3
  • Git使用教程:https://blog.csdn.net/tgbus18990140382/article/de...
    SkTj阅读 2,817评论 1 11
  • git 使用笔记 git原理: 文件(blob)对象,树(tree)对象,提交(commit)对象 tree对象 ...
    神刀阅读 3,796评论 0 10
  • 今天听了刘润五分钟商学院。以终为始。挺好的,现在做计划。这几天总觉得自己不会维护资源。要有原则。中间不要迷失掉自己...
    苏珊Fineyoga阅读 113评论 1 0