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

前端 未结 30 3821
失恋的感觉
失恋的感觉 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

    Instead of doing:

    git fetch --all
    git reset --hard origin/master
    

    I'd advise doing the following:

    git fetch origin master
    git reset --hard origin/master
    

    No need to fetch all remotes and branches if you're going to reset to the origin/master branch right?

提交回复
热议问题