2017-10-17 64 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

您能否解釋您的建議如何解決原始問題。通常應該避免只回答代碼。 –

相關問題