Reset local repository branch to be just like remote repository HEAD

后端 未结 21 1892
挽巷
挽巷 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 03:02

    If you don't mind saving your local changes, yet still want to update your repository to match origin/HEAD, you can simply stash your local changes and then pull:

    git stash
    git pull
    

提交回复
热议问题