What is the meaning of git reset --hard origin/master?

后端 未结 2 903
刺人心
刺人心 2021-01-29 17:58

I did a git pull and got an error:

The following working tree files would be overwritten by merge... Please move or remove them before you

2条回答
  •  温柔的废话
    2021-01-29 18:39

    git reset --hard origin/master
    

    says: throw away all my staged and unstaged changes, forget everything on my current local branch and make it exactly the same as origin/master.

    You probably wanted to ask this before you ran the command. The destructive nature is hinted at by using the same words as in "hard reset".

提交回复
热议问题