2017-08-31 55 views
-3

! [rejected] master -> master (fetch first) error: failed to push some refs to ' https://github.com/username/repo.git ': Updates were rejected because the remote contains work that you do not have locally. This is usually caused by another repository pushing to the same ref. You may want to first integrate the remote changes (e.g., 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.推送操作主原點不工作

+1

答案就在那裏的錯誤消息... – Thomas

+0

我是GitHub的新手。 @Thomas –

回答

0

有人正在與你在相同的存儲庫,他們已經做出了一些改變,你本地不具備,所以首先你需要做的

git pull origin master 

如果之後解決衝突有任何和最後你可以做

git push origin master 
+0

謝謝,它解決了我的問題! :) –

0

You may want to first integrate the remote changes hint: (e.g., 'git pull ...') before pushing again

拉第一,然後推到遠程因爲遙控器具有提交(S)中不存在本地。

$ git pull origin master 
$ git push origin master 
+0

謝謝,它解決了我的問題! :) –

0

聽起來像你需要從遠程拉下工作。最順利的方式可能是git fetch,然後是git rebase或消息建議git pull。前者將在遠程工作之上重做你的工作;後者將創建一個新的提交。

如果你一定你不關心遠程倉庫什麼的,你可以git push -f,但它是一個危險的操作,其中,遠程會失去老態。

這表示在上一次抓取遠程存儲庫和推送時間之間合併了一些其他工作。也許是你合併或其他人的工作拉請求?

+0

感謝您提供有用的信息,我是使用GitHub的新手。 –