基于指定Git标签修改并推送新标签,通过PR同步至main分支
基于指定标签做增量修改并同步到main分支的操作步骤
一、基于目标标签创建独立分支,隔离main分支的外部更新
直接从0.0.27-tempo标签创建专属分支,确保代码起点完全是该标签的状态,不会混入main分支的其他更新:
git checkout 0.0.27-tempo -b tempo-update-v0.0.28
二、完成增量修改并推送新标签
- 在
tempo-update-v0.0.28分支上完成tempo的代码修改、测试验证。 - 提交修改:
git add . git commit -m "feat(tempo): 增量修改内容说明"
- 基于当前提交创建新标签并推送到远程仓库:
git tag 0.0.28-tempo git push origin 0.0.28-tempo
注:这个新标签仅包含0.0.27-tempo的增量修改,完全独立于main分支的其他更新。
三、更新main分支的release.yaml并提交PR
为了确保release.yaml与main分支的最新配置兼容,避免冲突,单独创建分支处理版本更新:
- 切换到main分支并拉取最新内容:
git checkout main git pull origin main
- 创建用于更新release.yaml的分支:
git checkout -b update-tempo-release
- 修改
release.yaml中tempo的版本号:
deploy: - name: tempo targetRevision: 0.0.28-tempo - name: tempo-agent targetRevision: 0.0.20-tempo-agent
- 提交并推送分支:
git add release.yaml git commit -m "chore: 更新tempo版本至0.0.28-tempo" git push origin update-tempo-release
- 在GitHub上创建从
update-tempo-release到main的Pull Request,等待审核合并即可。
内容的提问来源于stack exchange,提问作者W Khan
相关产品推荐
相关产品推荐

