Merging a branch of a branch after first branch is squashed when merged to master

前端 未结 3 422
温柔的废话
温柔的废话 2021-01-29 19:17

Here\'s a workflow that I commonly deal with at work.

git checkout -b feature_branch
# Do some development
git add .
git commit
git push origin feature_branch
         


        
3条回答
  •  难免孤独
    2021-01-29 19:48

    In this particular case it seems you "know" that only the squashed work of the branch you originally worked on has been put into master.

    So you can happily merge by keeping your changes every time when there is a conflict. There is an option for that:

    git merge -Xours master

    See https://git-scm.com/docs/git-rebase for details more details.

提交回复
热议问题