新的git用户使用netbeans支持REJECTED_NONFASTFORWARD错误

时间:2012-11-13 18:26:39

标签: git netbeans

我是新的GIT用户,在win7上使用内置的NetBeans支持。我对项目文件进行了一些更改。当我尝试将它们推送到远程服务器时,我将在第二年开始。

git push git@bitbucket.org:******/**.git +refs/heads/master:refs/heads/master
Remote Repository Updates
Branch : master
Old Id : f2f9c7d23813d4ccc838d9aa0abd4875*******
New Id : 9277c9b01cf8d1aaff23003ce771cf*******
Result : REJECTED_NONFASTFORWARD

 Local Repository Updates
 Branch : origin/master
 Old Id : f2f9c7d23813d4ccc838d9aa0abd4875******
 New Id : 9277c9b01cf8d1aaff23003ce771cf*******
 Result : NOT_ATTEMPTED

 ==[IDE]== Nov 13, 2012 1:14:35 PM Pushing finished.

有人可以解释发生了什么,我不知道下一步该做什么。

提前致谢,

比尔

1 个答案:

答案 0 :(得分:1)

Git告诉您,自上次对其进行同步以来,远程存储库已经有了更新。您需要将这些更改提取到本地系统(使用Netbean等效的git pull)并将它们集成到本地存储库中,然后您就可以将其推送到远程存储库。

这就是命令行中的git push在这种情况下所说的:

error: failed to push some refs to 'remote.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

该手册页的相关部分说:

  

关于快速前进的说明

   When an update changes a branch (or more in general, a ref) that used
   to point at commit A to point at another commit B, it is called a
   fast-forward update if and only if B is a descendant of A.

   In a fast-forward update from A to B, the set of commits that the
   original commit A built on top of is a subset of the commits the new
   commit B builds on top of. Hence, it does not lose any history.