Git merge with force overwrite

前端 未结 6 660
悲哀的现实
悲哀的现实 2021-01-29 19:03

I have a branch called demo which I need to merge with master branch. I can get the desired result with following commands:

git pull or         


        
6条回答
  •  北海茫月
    2021-01-29 19:32

    When I tried using -X theirs and other related command switches I kept getting a merge commit. I probably wasn't understanding it correctly. One easy to understand alternative is just to delete the branch then track it again.

    git branch -D 
    git branch --track  origin/
    

    This isn't exactly a "merge", but this is what I was looking for when I came across this question. In my case I wanted to pull changes from a remote branch that were force pushed.

提交回复
热议问题