开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜