Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git 更新被拒绝,因为当前分支的提示已过期?_Git_Github - Fatal编程技术网

Git 更新被拒绝,因为当前分支的提示已过期?

Git 更新被拒绝,因为当前分支的提示已过期?,git,github,Git,Github,我的故事: 我正在处理一个项目,无意中,我将同一个提交消息下的所有更改提交给了Github,但这不是问题所在,我使用了 git reset --soft HEAD~1 所有问题都在本地解决,现在我正试图再次将其推送到Github,但我始终得到以下信息: error: failed to push some refs to 'https://github.com/dr-coder/Chat-App.git' hint: Updates were rejected because the tip

我的故事:

我正在处理一个项目,无意中,我将同一个提交消息下的所有更改提交给了Github,但这不是问题所在,我使用了

git reset --soft HEAD~1
所有问题都在本地解决,现在我正试图再次将其推送到Github,但我始终得到以下信息:

error: failed to push some refs to 'https://github.com/dr-coder/Chat-App.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回购再次返回到推送状态???

由于您是唯一一个处理回购的人,您可以执行以下操作:

git-push --force
如果没有,可以使用以下命令还原旧更改:

git checkout -b old-state COMMIT

这将创建一个带有要还原到的提交的分支。

我认为Git历史记录是您在本地更改的。你要么需要在本地修复历史记录,要么强制推送到远程repo(这非常危险),但问题不在本地我想,github中的问题,它还有一个提交我需要恢复,但我不知道如何恢复,我在网站上尝试过,但git和github对我来说都是新的如果你是唯一一个致力于该repo的开发人员,然后你可以做一个力推来解决你的问题issue@konekoya谢谢你,这已经成功了,如果你想的话,你可以添加你的答案。没问题,我真的不确定它是否有效:)提交是SHA???@CodeEagle是的