How do I force “git pull” to overwrite local files?

前端 未结 30 3855
失恋的感觉
失恋的感觉 2020-11-21 11:35

How do I force an overwrite of local files on a git pull?

The scenario is the following:

  • A team member is modifying the t
30条回答
  •  不要未来只要你来
    2020-11-21 12:07

    I know of a much easier and less painful method:

    $ git branch -m [branch_to_force_pull] tmp
    $ git fetch
    $ git checkout [branch_to_force_pull]
    $ git branch -D tmp
    

    That's it!

提交回复
热议问题