2013-02-10 38 views
1

問題/推未能一些裁判推到magit「https://github.com/myname/myrepo」

我開始使用magit,在git的經驗非常少。

我已經走線槽magit手動與成功:

adding 
ignoring 
staging 
commiting locally 

於是,我試着推github.com/myname。爲此,我使用「P P」,輸入我的用戶名和密碼。

如果失敗,

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

git exited abnormally with code 1.

我以爲我會解決它在這裏與 混帳mentionned配置--global push.default當前 但它並不能幫助。

我有一個樂在Geting an error pushing to github - Updates were rejected because a pushed branch tip is behind its remote但did'nt得到它的工作

任何想法?

+2

你讀過提示嗎? – SLaks 2013-02-10 19:58:36

+0

@SLaks - 是的... thks無論如何 – JeanMichel 2013-02-10 21:13:00

回答

5

您必須先更改pull或更改push -f

+1

thks! push -f解決了這個問題\ n從magit內部可行 – JeanMichel 2013-02-10 21:10:38

2

我一直都很喜歡使用git pull --rebase,然後git push origin master,因爲很多你可以工作的地方都不允許push -f。

git pull --rebase 
git push origin master 

這個rebase會將你的改變應用到遠程(在線網站)之後。這段視頻字面上看你的確切問題,並解決它使用git pull --rebase https://youtu.be/IhkvMPE9Jxs?t=10m36s

相關問題