10

I just installed netbeans and connect to my git repository throught ssh.

Everything works fine except pushing master branch. Every time I commit some changes on master branch and trying to push branch I get this popup:

There were errors during the push.
Open output to see more details.

and the details are

==[IDE]== Jun 30, 2012 4:29:42 PM Pushing finished.
==[IDE]== Jun 30, 2012 4:32:38 PM Pushing
git push ssh://50.57.180.187:22/var/www/netbeans +refs/heads/master:refs/heads/master
Remote Repository Updates
Branch : master
Old Id : cc6de40b3236047b0212e318f9977a7b75395177
New Id : fe8f3af403524ba5731fdf1e0b8773c4ef223840
Result : REJECTED_OTHER_REASON

Local Repository Updates
Branch : origin/master
Old Id : cc6de40b3236047b0212e318f9977a7b75395177
New Id : fe8f3af403524ba5731fdf1e0b8773c4ef223840
Result : NOT_ATTEMPTED

==[IDE]== Jun 30, 2012 4:32:43 PM Pushing finished.

But with other branches everything works great. Am I doing something wrong?

EDIT: Remote repo was not bare, more info here

Community
  • 1
  • 1
k3rn3lPan1c
  • 263
  • 1
  • 3
  • 8

3 Answers3

1

You must be trying to push a new commit to replace an existing commit already push ("history rewritten")

You need to do a git push --force, or select a similar option (if supported) in the git push wizard dialog of NetBeans.
And that suppose that the "push --force" is authorized on the remote repo (which isn't always the case).
If other have already pulled from the remote repo, rewriting its history is generally not a good idea.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Other alternative to `git push --force`: http://stackoverflow.com/questions/253055/how-do-i-push-amended-commit-to-the-remote-git-repo – VonC Jun 30 '12 at 15:07
  • @neckTwi that would be better answered if you put that as a separate question, with a link back to this one, and with full details (OS, version of Netbeans and git, exact error message in text, not in picture, ...) – VonC Jul 02 '14 at 14:57
  • Thank you. I shall do it n post u back. – Necktwi Jul 03 '14 at 05:50
0

Looks like the problem is that your git repository is not bare.

To verify yo can try pushing via git on the command line, it will give more detailed explanation.

The problem might be that master is currently checked out at remote repository. To be able to push master branch you can try checking out something else than master on remote repository.

denis
  • 417
  • 3
  • 8
0

I had the same issue with push via netbeans (on mac), caused by another circumstance:

I (accidentally) used german umlauts (ü,ä,ö) for the name of my branch when creating it locally. Working locally worked fine until i tried to push it to the remote repository.

My workaround: create another branch locally without umlaut in its name, merge the wrong named branch into it, push the new one to the remote repo.

hope this helps someone saving time while searching the solution.

ndo
  • 96
  • 7