使分支指向发起它的分支的尖端

问题描述 投票:0回答:1

我在系统中执行了以下功能的QA:

  • staging创建了master分支。
  • 合并功能分支task-123staging
  • staging部署到测试服务器。
  • QA的功能。

QA失败了,现在我想让staging回到master的最新提交,因此它将为其他功能分支的QA做好准备。

如何使用相对分支参考(无哈希)来完成?

git branch branching-and-merging
1个回答
1
投票

我认为这就是你想要的,但这是一个基本的“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
© www.soinside.com 2019 - 2024. All rights reserved.