将一个分支移动到一个新的标签

10
我的个人WordPress安装是从GitHub上的wordpress git mirror克隆的。我检出了2.7.1标签到"stable"分支(git checkout -b stable 2.7.1),一直运行良好。现在WordPress 2.8已经发布,我想将我的稳定分支移动到2.8标签。
我尝试了以下操作(都在稳定分支上),但是会出现冲突,因为它尝试应用每个提交,似乎有些不对劲。我在稳定分支上没有进行任何本地更改/提交。
git fetch 
git fetch --tags
git rebase 2.8

First, rewinding head to replay your work on top of it...
Applying: Prepare the branch for the inevitable.
error: patch failed: wp-includes/version.php:8
error: wp-includes/version.php: patch does not apply
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Auto-merging wp-includes/version.php
CONFLICT (content): Merge conflict in wp-includes/version.php
Failed to merge in the changes.
Patch failed at 0001 Prepare the branch for the inevitable.

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To restore the original branch and stop rebasing run "git rebase --abort".

我应该如何将我的稳定分支“移动”到2.8标签?

2个回答

16
# git checkout stable
# git reset --hard 2.8

就是那样。


11

使用命令"git checkout 2.8"。

如果您想移动"stable",您可以简单地删除/重新创建它:

$ git checkout 2.8
$ git branch -d stable
$ git checkout -b stable

11
git checkout -f -b stable 2.8 - Jakub Narębski

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接