failed to push some refs to git@heroku.com:myapp.git

前端 未结 1 1144
盖世英雄少女心
盖世英雄少女心 2021-01-25 18:35

I am getting this error when I am trying push my files into heroku rep. Ive tried following solutions but none helped:

  1. this
  2. Tried git pull heroku ma
相关标签:
1条回答
  • 2021-01-25 18:56

    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.

    0 讨论(0)
提交回复
热议问题