2017-10-17 65 views
-1

我试图移动本地存储库来到位桶的工作,我在下面这个tutorial但是当我做更新被拒绝,因为远程包含您做

git push --all bitbucket 

我得到了以下meessage错误:

To https://bitbucket.org/growtec/offshore.git 
! [rejected]  Leonardo -> Leonardo (fetch first) 
! [rejected]  master -> master (fetch first) 
error: failed to push some refs to 'https://[email protected]/growtec/offshore.git' 
hint: Updates were rejected because the remote contains work that you do 
hint: not have locally. This is usually caused by another repository pushing 
hint: to the same ref. You may want to first integrate the remote changes 
hint: (e.g., 'git pull ...') before pushing again. 
hint: See the 'Note about fast-forwards' in 'git push --help' for details. 

我在主分支和我已经做了git pull但输出是一切先进的日期。

我看到这个question,但它并没有为工作我

+1

我建议*避免*'git的pull'完全,但因为你正在使用它:(1)做遥控器,你有('混帐remote'会列出他们)? (2)“master”分支名称的“上游”设置是什么? ('git rev-parse --symbolic-full-name master @ {upstream}'会显示它。)(3)你的'Leonardo'分支名称的'upstream'设置是什么? – torek

回答

-1

我所解决的问题:

git push bitbucket master --force 
1

你做了git pullmaster分支,但如果你在你的git push --all bitbucket命令是干什么的,它也试图把Leonardo分公司密切关注,你从来没有拉过。您可以尝试拉这个分支为好,然后又都推:

git checkout Leonardo 
git pull origin Leonardo 
git push --all bitbucket 
+0

我试过了,但是我仍然收到相同的消息错误 –

+0

您是否再次拉'master',因为您上次拉动后可能发生了对远程'master'的新提交? –

+0

是的,一切都是最新的。 –

0

如果一切都已经是最新的。尝试git push -f origin master. -f代表强制承诺。希望这可以帮助。

0
git pull origin master 
git fetch origin Leonardo:Leonardo 
git push --all bitbucket 
+3

您能否解释您的建议如何解决原始问题。通常应该避免只回答代码。 –

相关问题