我正在尝试将我的代码推送到我的远程分支,但一直收到此错误:
! [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和许多其他与无济于事。
我还尝试了以下问题的答案,但没有成功: