I am getting this error when I am trying push my files into heroku rep. Ive tried following solutions but none helped:
git pull heroku ma
It seems like you indeed have merge conflicts with the upstream. I suggest the following:
1. run git fetch origin
2. run git log ..origin/master
to see what's new in the original that you still don't have. Note that 'git push -f' will override these commits if you attempt it...
3. run git pull --rebase
(this might again fail with merge conflicts). After a successful pull and rebase your push should work. I would, however, pay close attention to those merge conflicts since it seems in your case they stem from a garbled history (maybe a previous merge/rebase gone awry?)
4. If all else fails, create a new branch, pointing at the origin/master (git checkout -b new_master origin/master
), and then, using git-log
and git-cherry-pick
- fish out the only commits that are truly new in relation to origin/master. Then push this new branch and archive the old master.
Assuming the above four ways all fail, there might be a problem on the remote repository.