After git reset --hard HEAD
, git pull
says: Untracked working tree file ... would be overwritten by merge
any ideas?
I did try a git fetch
and git fetch --all
already...
The reason for error messages like these is rather simple: you have local changes that would be overwritten by the incoming new changes that a "git pull" would bring in. For obvious safety reasons, Git will never simply overwrite your changes.
If you just want to update your local to the origin's state, you could use described here solution:
$ git fetch origin
$ git reset --hard origin/master
you have untracked files. Simply
git stash -u
to stow them away in the stash and get a clean work tree (-u
specifies that you want to stash modifications along with new files). After you pull, merge, rebase or whatever, you can
git stash pop
to get them back.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With