发出请求,然后无意中进行了一些额外的提交,并且无法返回到分支中的第一次提交。
我做什么:
git reset HEAD@{10}
git add .
git commit --amend --no-edit
git push origin areaSelection
错误:
To https://github.com/YaroshenkoYaroslav/WorldEdit.git
! [rejected] areaSelection -> areaSelection (non-fast-forward)
error: failed to push some refs to 'https://github.com/YaroshenkoYaroslav/WorldEdit.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.
我该如何解决?
答案 0 :(得分:1)
您有两个选择,这可能仅取决于团队中的约定或对github存储库的限制。
git push --force-with-lease
。