How to merge the current branch into another branch

前端 未结 8 959
忘了有多久
忘了有多久 2020-12-04 04:44

I have two branches, master and dev. I always work on dev and only check code into the master branch once it\'s been approved for production use. When I do so, I have to do

8条回答
  •  失恋的感觉
    2020-12-04 05:29

    A lot of times you're coming from the branch you would like to merge the current branch into. In that case you could do:

    git co - && git merge @{-1}

    for example:

    git checkout somebranch      // (while on master)
    
    // add some commits
    
    git co - && git merge @{-1}  // will merge somebranch into master
    

提交回复
热议问题