Merge up to a specific commit

后端 未结 4 1889
旧巷少年郎
旧巷少年郎 2020-11-29 14:59

I created a new branch named newbranch from the master branch in git. Now I have done some work and want to merge newbranch to m

4条回答
  •  醉酒成梦
    2020-11-29 15:16

    To keep the branching clean, you could do this:

    git checkout newbranch
    git branch newbranch2
    git reset --hard  # the commit at which you want to merge
    git checkout master
    git merge newbranch
    git checkout newbranch2
    

    This way, newbranch will end where it was merged into master, and you continue working on newbranch2.

提交回复
热议问题