无法使用NetBeans将master分支推送到git存储库

问题描述:

我刚刚安装了netbeans,并通过ssh连接到我的git存储库.

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

除推送master分支外,其他一切都正常.每次我在master分支上进行一些更改并尝试推送分支时,都会显示以下弹出窗口:

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.

详细信息是

==[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?

远程仓库不是裸露的,更多信息

Remote repo was not bare, more info here

您必须尝试推送新的提交以替换已经推送的现有提交(历史记录已重写")

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

您需要执行git push --force,或在git NetBeans的推送向导对话框.
并且假定"push --force"在远程存储库上得到了授权(并非总是这样).
如果其他人已经从远程仓库中撤出,那么重写其历史记录通常不是一个好主意.

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.