Git Pull While Ignoring Local Changes?

前端 未结 12 1728
醉话见心
醉话见心 2020-12-04 04:29

Is there a way to do a git pull that ignores any local file changes without blowing the directory away and having to perform a git clone?

12条回答
  •  醉梦人生
    2020-12-04 05:00

    For me the following worked:

    (1) First fetch all changes:

    $ git fetch --all
    

    (2) Then reset the master:

    $ git reset --hard origin/master
    

    (3) Pull/update:

    $ git pull
    

提交回复
热议问题