I run into this sometimes:
- On server,
git clone myrepo
- Change
foo.sh
on machine 1 to solve some problem. - It works, so replicate the change on my development machine.
- On dev machine,
git add foo.sh
,git commit
,git push
On server,
git pull
remote: Counting objects: 1, done. remote: Compressing objects: 100% (1/1), done. remote: Total 5 (delta 4), reused 5 (delta 4) Unpacking objects: 100% (5/5), done. From ... c78..e4d master -> origin/master Updating c78..e4d error: Your local changes to the following files would be overwritten by merge: foo.sh Please, commit your changes or stash them before you can merge. Aborting
Is there a way that Git could be a bit smarter, and notice that the "local changes" are identical to the merge changes? Obviously I could simply git reset --hard
', but I'd like to double check that the changes I've made remotely really are the same.