小编Mei*_*kay的帖子

无论我做什么,我都无法推送我的代码并不断收到相同的错误

我正在尝试将我的代码推送到我的远程分支,但一直收到此错误:

! [rejected] (non-fast-forward)
error: failed to push some refs to 'git@github.com:
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
Run Code Online (Sandbox Code Playgroud)

我认为可能导致这种情况的原因是我在 github 上的 README.md 中修复了一个错字,而不是通过我的本地环境。

我已经查看了堆栈溢出并尝试了他们针对此问题提到的命令,例如git pull, git pull --rebase, git pull origin master,git push --f和许多其他与无济于事。

我还尝试了以下问题的答案,但没有成功:

更新被拒绝,因为您当前分支的提示在提示后面:它的远程副本。集成远程更改(例如 [重复]

无法推送到 GitHub …

git github git-push

5
推荐指数
1
解决办法
1160
查看次数

标签 统计

git ×1

git-push ×1

github ×1