美文网首页
cherry-pick

cherry-pick

作者: itsmyturn | 来源:发表于2020-04-23 17:19 被阅读0次

    一,在远程新建一个分支

    image.png
    image.png
    image.png

    二,将本地分支切换的新建的分支上

    wenjun.lv@wenjunlvdeMacBook-Air fe % git checkout -b 4.5.1_lvwenjun origin/4.5.1_lvwenjun
    

    三,找到自己之前的开发分支,找到提交的commitid 查看历史

    image.png
    image.png

    四,进行cherry-pick操作(如果本地有多次commit提交,分别cherry-pick)

    wenjun.lv@wenjunlvdeMacBook-Air fe % git cherry-pick 81f956762bfc959de227771a62af0e6ff9b9d875
    [4.5.1_lvwenjun 741d670c02] 病历书写editable
     Date: Thu Apr 23 16:51:33 2020 +0800
     4 files changed, 44 insertions(+), 23 deletions(-)
    

    五,如果本地有修改就commit一下,如果没有直接push

    wenjun.lv@wenjunlvdeMacBook-Air fe % git commit -am 'cherry-pick'
    On branch 4.5.1_lvwenjun
    Your branch is ahead of 'origin/4.5.1_lvwenjun' by 1 commit.
      (use "git push" to publish your local commits)
    
    nothing to commit, working tree clean
    
    wenjun.lv@wenjunlvdeMacBook-Air fe % git push
    Enumerating objects: 19, done.
    Counting objects: 100% (19/19), done.
    Delta compression using up to 4 threads
    Compressing objects: 100% (10/10), done.
    Writing objects: 100% (10/10), 1.53 KiB | 195.00 KiB/s, done.
    Total 10 (delta 9), reused 0 (delta 0)
    remote: 
    remote: To create a merge request for 4.5.1_lvwenjun, visit:
    remote:   http://gitlab.everjiankang.com/ever/fe/merge_requests/new?merge_request%5Bsource_branch%5D=4.5.1_lvwenjun
    remote: 
    To gitlab.everjiankang.com:ever/fe.git
       a7105a0e2f..741d670c02  4.5.1_lvwenjun -> 4.5.1_lvwenjun
    

    六进行mergerequest操作(一定要查看一下change,看看是不是自己改的代码)

    image.png image.png

    相关文章

      网友评论

          本文标题:cherry-pick

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