Reputation: 11
$git pull
Updating 08f6632..e29f7b0
error: Your local changes to the following files would be overwritten by merge:
file.txt
Please commit your changes or stash them before you merge.
Aborting
Which would be fine. Sure some files are different.
git reset --hard
Now no changes should exist.
Now when we run pull we expect no changes to exist.
$git pull
Updating 08f6632..e29f7b0
error: Your local changes to the following files would be overwritten by merge:
file.txt
Please commit your changes or stash them before you merge.
Aborting
Dose someone know what is causing this / and how to fix it.
Upvotes: 1
Views: 1136
Reputation: 126
You have non committed work. To make sure you don't loose part of your work, Git doen't allow you the operation of git pull
(which is equivalent to git fetch
and then git merge
).
If you want to save your progress I suggest to create a new commit and then you can pull.
The other way is to use git stash
to temporarily store uncommitted work in order to clean out your working directory, without performing a new commmit.
Upvotes: 1