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

前端 未结 30 3520
失恋的感觉
失恋的感觉 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 11:59

    I had the same problem. No one gave me this solution, but it worked for me.

    I solved it by:

    1. Delete all the files. Leave just the .git directory.
    2. git reset --hard HEAD
    3. git pull
    4. git push

    Now it works.

提交回复
热议问题