How to do a non-fast-forward git merge to a branch that isn't checked out?

前端 未结 5 1798
误落风尘
误落风尘 2021-01-04 11:31

I\'m on branch a. I want to merge branch b into branch c. The merge is not a fast-forward, but it also doesn\'t require manual resolut

5条回答
  •  再見小時候
    2021-01-04 12:18

    You can write a script even if your working directory is dirty. You will have to stash your changes first.

    git stash
    git checkout c
    git merge b
    git checkout a
    git stash pop
    

提交回复
热议问题