git - 无法将某些引用推送到 'https://github.com/myname/myrepo'

标签 git emacs github magit

关于 magit/push 的问题

我开始使用 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.

我想我会像这里提到的那样解决它 git config --global push.default 当前 但这没有帮助。

我对 Geting an error pushing to github - Updates were rejected because a pushed branch tip is behind its remote 感兴趣但没有得到它的工作

有什么想法吗?

最佳答案

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

关于git - 无法将某些引用推送到 'https://github.com/myname/myrepo',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14801972/

相关文章:

git - 如何更改 git diff 中的制表符宽度?

css - 为什么 Rails 会记住删除的 css?

php - 将 Git 与共享托管计划一起使用

emacs - 在 emacs 中通过 ssh 打开文件

emacs - 使用 Emacs 删除字节顺序标记 (BOM)

Eclipse Git Synchronize 不显示更改

emacs - 在 perl 模式 emacs 中关闭自动缩进

ubuntu - 使用 Chef 开源服务器部署带有密码的私有(private) git 存储库

eclipse - 无法在从 Git 导入的 Eclipse 中运行项目

java - 当 git push 到远程仓库时出现错误 "File java_pid66619.hprof is 661.61 MB; this exceeds GitHub' s 文件大小限制为 100.00 MB"