【问题标题】:failed to push some refs to 'https://github.com/myname/myrepo'未能将一些参考资料推送到“https://github.com/myname/myrepo”
【发布时间】:2013-01-25 22:54:25
【问题描述】:

关于 magit/push 的问题

我开始使用 magit,对 git 的经验很少。

我已经成功阅读了 magit 手册:

adding
ignoring
staging
commiting locally

然后,我尝试推送 github.com/myname。为此,我使用“P P”,然后输入我的用户名和密码。

如果失败

https://github.com/myname/myrepo! [rejected] master -> master (non-fast-forward) 错误:未能将一些引用推送到'https://github.com/myname/myrepo'
提示:更新被拒绝,因为您当前分支的尖端落后
提示:它的远程对应物。合并远程更改(例如“git pull”)
提示:在再次推送之前。
提示:有关详细信息,请参阅“git push –help”中的“关于快进的说明”。

git 异常退出,代码为 1。

我想我会像这里提到的那样解决它 git config --global push.default 当前 但这无济于事。

我在Geting an error pushing to github - Updates were rejected because a pushed branch tip is behind its remote 上玩过,但没有成功

有什么想法吗?

【问题讨论】:

  • 你读过提示了吗?
  • @SLaks - 是的......无论如何

标签: git emacs github magit


【解决方案1】:

您必须先pull 更改或push -f 更改。

【讨论】:

  • 谢谢! push -f 解决了这个问题 \n 它在 magit 中是可行的
【解决方案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

解决了它

【讨论】:

    猜你喜欢
    • 2023-03-30
    • 2020-12-30
    • 1970-01-01
    • 1970-01-01
    • 2018-03-27
    • 2012-04-05
    • 1970-01-01
    • 1970-01-01
    • 2012-08-16
    相关资源
    最近更新 更多