I am trying to push new changes, but I have a conflicted file. After trying to push, I get the following error:
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.
Ok, so we need to use git pull.
I try to use git pull
and then I get this error:
error: Your local changes to the following files would be overwritten by merge:
db/profile_edit.php
Please, commit your changes or stash them before you can merge.
But, when I try to commit, I go back to the first error. What should I do? The changes on the remote repo are newer than the ones on my local machine. So, how do I open it up with a diff tool and make the changes and then tell git that I have made changes so it will let me push changes?
Try to do
$ git pull --rebase
To pull remote changes before yours, and then commit. And see if it works.
If this does not work, try this instead:
$ git stash
$ git pull --rebase
$ git stash pop
To save your changes on the stash
, apply remote commits inside your work-repository, and then apply your changes (saved into stash
) inside your work-repository again.
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