Reputation: 39243
Where is
git pull --force
as in rm -rf
and then git clone
again from scratch?
End result should be git diff
returns nothing.
Upvotes: 11
Views: 7679
Reputation: 8458
In addition to the other answers, I would also add a git clean -fdx
to remove all untracked files and directories, to avoid potential issues with files being added in the remote repository, but also present in the current clone.
git clean -fdx
git fetch
git reset --hard origin/master
Upvotes: 19
Reputation: 13205
Reset your working directory back to the latest pull:
git reset --hard
Then pull as usual
Upvotes: 3
Reputation: 387587
You use git fetch
to fetch everything from the remote repository. Then you can just git reset --hard origin/master
to reset your current branch to origin’s master and reset your working directory.
Upvotes: 4