-5

Why does git give me an error when I try to push an amended commit? (I did commit - push - amend - push --> error)

Sensei
  • 598
  • 1
  • 4
  • 13
  • 1
    -1 Ask one question at a time. And spend the time to make it a good question. I'm not sure how you ask about a git error without posting the actual error message ! – Andomar May 12 '13 at 19:15
  • 2
    For your first question, see http://stackoverflow.com/questions/253055/how-do-i-push-amended-commit-to-the-remote-git-repo – Yang May 12 '13 at 19:39
  • To the Rest, these are minor questions in my opinion and I can't think of any other network which can answer these specific question. And also there is no support on the vim.org page or github page for these plugins. But I'm going go split the question for your convenience. – Sensei May 12 '13 at 20:11
  • @Sensei: there are the #git and #github irc channels, for one – Nevik Rehnel May 13 '13 at 05:46
  • and there is no limitation on the "minorness" of the question here on SO. if you have researched the question and provide the proper information so people have a chance to answer it, your questions are welcome, no matter the length – Nevik Rehnel May 13 '13 at 05:47

1 Answers1

1

Each commit in Git is identified by a hash.

As it happens, you push a first commit with a specific hash. Then you change its hash by distorting the commit (with the git commit --amend command).

So, when you push it again to the server, he don't understand what you want to do, hence the error.

You can oversteep this error with: git push -f your_origin your_branch. It's not recommended but it's possible.

aymericbeaumet
  • 6,853
  • 2
  • 37
  • 50
  • Credits go to @Yang for the link and gitster for the actual answer, but since you provided the only answer, I'll accept it. Instead of forcing the push the correct way to do it is merging. – Sensei May 13 '13 at 11:02