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

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

    These four commands work for me.

    git reset --hard HEAD
    git checkout origin/master
    git branch -D master
    git checkout -b master
    

    To check/pull after executing these commands

    git pull origin master
    

    I tried a lot but finally got success with these commands.

提交回复
热议问题