fancy
fancy

Reputation: 51453

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!

Upvotes: 2

Views: 1047

Answers (3)

fancy
fancy

Reputation: 51453

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

Upvotes: 5

Kit Ho
Kit Ho

Reputation: 26998

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

Upvotes: 0

Mat
Mat

Reputation: 206861

The simplest is probably to simply clone the remote repository again.

Upvotes: 1

Related Questions