我的分支是 origin
,我从中另一个分支派生出来的是 upstream
我需要从我的分支中删除一次提交,但我希望在其他人需要另一个分支派生时更新 upstream
仓库(目前只有我)。
到目前为止,我已经完成了以下工作:
git checkout MYBRANCH
git reset --hard <SHA_COMMIT_HASH>
git push origin MYBRANCH
目前我的upstream
仓库已受保护(在某个时间点上会受到保护),因此我尝试将其推送到该仓库,但出现了以下消息。我尝试强制推送,但也没有成功。我再次检查了分支,发现它并未受到保护。
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.