Reset local repository branch to be just like remote repository HEAD

后端 未结 21 1903
挽巷
挽巷 2020-11-22 02:19

How do I reset my local branch to be just like the branch on the remote repository?

I did:

git reset --hard HEAD

But when I run a <

21条回答
  •  天涯浪人
    2020-11-22 02:57

    Use the commands below. These commands will remove all untracked files from local git too

    git fetch origin
    git reset --hard origin/master
    git clean -d -f
    

提交回复
热议问题