我在系统中执行了以下功能的QA:
staging
创建了master
分支。task-123
到staging
。staging
部署到测试服务器。QA失败了,现在我想让staging
回到master
的最新提交,因此它将为其他功能分支的QA做好准备。
如何使用相对分支参考(无哈希)来完成?
我认为这就是你想要的,但这是一个基本的“git 101”,我不禁感到我错过了一些东西,你想要更复杂的东西。
如果你想将staging
重置回你开始的地方
<in the staging branch>
git reset --hard $(git merge-base HEAD origin/master)
git push --force
如果要将staging
重置为master的当前状态
<in the staging branch>
git fetch
git reset --hard origin/master
git push --force