Reputation: 1017
I'm new with git, and I made some changes to my script, committed and pushed them to my bitbucket account. When I tried to Upload the newer script version to the server, I got the following error:
error: Your local changes to the following files would be overwritten by merge:
web_app.py
Please, commit your changes or stash them before you can merge.
Aborting
Can anyone tell me how to run-down the version on the server, and get the version I fixed on my bitbucket?
So far I've tried:git reset myfile.py
and then git pull
but, I got the same error
Upvotes: 1
Views: 85
Reputation: 33864
You want git checkout .
to remove local modifications and git pull
to pull down the new modifications.
Be aware that this will remove all local modifications, so check this if you want to just do 1 file:
Undo working copy modifications of one file in Git?
If you want to save the local modifications, but pull down the changes you can do:
git stash save // To save the local mods in the stash
git pull // To pull down remote mods
git stash pop // To put back the local modifications
Be aware that if you have changed the same lines in the file you may need to resolve conflicts.
Upvotes: 4