首页 > 解决方案 > 错误:未能将一些参考推送到 'git@github.com:MyGitHub/foo.git'

问题描述

我更改了 GitHub 中两个文件的目录。现在,无论我尝试什么,Git 都不会将任何更改推送到 GitHub。我得到的错误是:

 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:MyGitHub/foo.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.

这个解决方案对我不起作用。 这个解决方案对我不起作用。将我的远程存储库重新克隆到我的本地不起作用。即使完全删除 github 中的文件(我已将其保存在其他地方)也不起作用。

如何使此错误消失并恢复再次推送到我的 GitHub 的能力?

标签: gitgithub

解决方案


推荐阅读