2012-05-25 19 views
27

我收到以下错误。我该如何解决?: git add。 git的承诺-M 'T' 混帐推起源发展GitHub - 错误:未能推动一些裁判'[email protected]:myrepo.git'

To [email protected]:myrepo.git 
! [rejected]  development -> development (non-fast-forward) 
error: failed to push some refs to '[email protected]:myrepo.git' 
To prevent you from losing history, non-fast-forward updates were rejected 
Merge the remote changes (e.g. 'git pull') before pushing again. See the 
'Note about fast-forwards' section of 'git push --help' for details. 

回答

58

你的出身库是提前本地仓库。在推送之前,您需要按照以下步骤从源存储库中获取更改。这可以在您的提交和推送之间执行。

git pull origin development 

development指的是你想从中拉出的分支。 如果你想从master分支拉,然后输入这一个。

git pull origin master 
+8

上述消息中的'development'指的是你想要从中拉出的分支。所以如果你使用'master'分支,你可以输入:'git pull origin master' – Myna

+0

这工作完美谢谢! –

4

您可以在控制台写:

git pull origin 

然后按TAB,写你的 “主” 库

1

在Windows中,则需要用双引号 “”。于是命令将

git的承诺-m“T”

1

在我的情况git push努力推动更多的只是当前分支,因此,我得到这个错误,因为其他部门同步没有。

要解决您可以使用:git config --global push.default simple 这将使git只推送当前分支。

这只适用于更新版本的git。即:不会在1.7.9.5上工作

-1
$ git fetch --unshallow origin 
$ git push you remote name 
相关问题