1

我是一个新的 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.

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

提前致谢,

账单

4

1 回答 1

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.
于 2012-11-13T18:28:57.950 回答