git使用

作者: 在下陈小村 | 来源:发表于2018-08-07 11:50 被阅读15次

    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

    相关文章

      网友评论

          本文标题:git使用

          本文链接:https://www.haomeiwen.com/subject/sgcuvftx.html