2016-09-20 119 views
1

我正在設計我的web應用程序,現在我想將更改推送到我的回購站。如何將更改推送到github

我試圖git push orgin master,進入我的userame /正確密碼,並收到此錯誤:

! [rejected]  master -> master (non-fast-forward) 
error: failed to push some refs to 'https://github.com/username/project.git' 
hint: Updates were rejected because the tip of your current branch is behind 
hint: its remote counterpart. Integrate the remote changes (e.g. 
hint: 'git pull ...') before pushing again. 
hint: See the 'Note about fast-forwards' in 'git push --help' for details. 

所以,我想git pull orgin master(其中成功下載其他用戶添加的變化),然後我重新嘗試git push orgin master和相同的結果。再次。

我也試過

git init 
git add . 
git commit -m "Styled notifications" 

回答

1

唯一的解釋了這裏面想到的是,別人推新提交給你拉,推的時間之間的遠程master分支。你可以嘗試在快速連續以下兩條命令:

git pull origin master 
git push origin master 

注意git pull將合併遙控器上的變化到您當地的分行,但這個替代是改爲變基:

git pull --rebase origin master 
+0

這並沒有幫助。我一直得到同樣的錯誤。我只是手動添加文件! – GVS

+1

'我只是手動添加文件'...這是什麼意思?拉應明確地將您的本地分支與遙控器進行更新。 –