Reset local git repo to exactly that of remote?
Reset local git repo to exactly that of remote?
开发者_开发百科What is the best way to do this?
Thanks!
reset to the last commit in remote git reset HEAD --hard
replace HEAD with the latest remote commit if it isn't head
then clean out everything else git clean -fd
The simplest is probably to simply clone the remote repository again.
You can use
git pull
but becare that this will merge your local branch to the state of the remote branch at the same time.
If no, that a fast-forward merge will be done and that's what you need
精彩评论