2013-02-10 40 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

相关问题