将分支移动到新标记

时间:2009-06-18 03:58:17

标签: git tags branch rebase

我的个人Wordpress安装是从GitHub上的wordpress git mirror克隆的。我检查了2.7.1标签到分支“稳定”(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 个答案:

答案 0 :(得分:16)

# git checkout stable
# git reset --hard 2.8

你去。

答案 1 :(得分:11)

使用“git checkout 2.8”。

如果你想移动“稳定”,你可以简单地删除/重新创建它:

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