我有两个分支:master,joy。有一个名为'hello'的文件,我输入命令'git rebase joy',有冲突,而且冲突内容很奇怪。
以下是详细步骤
- 1.
git结账大师
猫你好
显示 ==>
Hello world
- 2.
git结帐喜悦
猫你好
显示 ==>
Hello world
one line
two line
- 3.
git结账大师
git rebase 喜悦 ==>
First, rewinding head to replay your work on top of it...
Applying: cherry-pick
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Auto-merging hello
CONFLICT (content): Merge conflict in hello
Failed to merge in the changes.
Patch failed at 0001 cherry-pick
猫你好==>
Hello world
<<<<<<< HEAD
one line
two line
=======
add one line
add 2nd line
>>>>>>> cherry- pick
但是我希望找到的是没有冲突,内容是
Hello world
one line
two line
- 5.
我下面的版本树在学习后相当复杂
* <b04ea3b> 2012-06-09 [yaoyangyong] (HEAD, joy) test rebase
* <5b595d6> 2012-06-09 [yaoyangyong] joy clear hello
| * <eeba7d9> 2012-06-09 [yaoyangyong] (master) clean hello
| * <1dbc3b8> 2012-06-09 [yaoyangyong] merge confilct
| |\
| |/
|/|
| * <3cb9d88> 2012-06-09 [yaoyangyong] modify master 1st line
* | <b1724ad> 2012-06-09 [yaoyangyong] test merge
| * <89a692f> 2012-06-09 [yaoyangyong] merge from joy
| |\
| |/
|/|
* | <dc96da9> 2012-06-09 [yaoyangyong] modify second line
| * <816f575> 2012-06-08 [yaoyangyong] joy
| |\
| |/
|/|
* | <93b5982> 2012-06-08 [yaoyangyong] 3line
| * <4400260> 2012-06-08 [yaoyangyong] cherry-pick
* | <233d6f2> 2012-06-08 [yaoyangyong] 2nd line comment
* | <60d6edc> 2012-06-08 [yaoyangyong] modify hello,add one line
|/
:
* <b04ea3b> 2012-06-09 [yaoyangyong] (HEAD, joy) test rebase
* <5b595d6> 2012-06-09 [yaoyangyong] joy clear hello
| * <eeba7d9> 2012-06-09 [yaoyangyong] (master) clean hello
| * <1dbc3b8> 2012-06-09 [yaoyangyong] merge confilct
| |\
| |/
|/|
| * <3cb9d88> 2012-06-09 [yaoyangyong] modify master 1st line
* | <b1724ad> 2012-06-09 [yaoyangyong] test merge
| * <89a692f> 2012-06-09 [yaoyangyong] merge from joy
| |\
| |/
|/|
* | <dc96da9> 2012-06-09 [yaoyangyong] modify second line
| * <816f575> 2012-06-08 [yaoyangyong] joy
| |\
| |/
|/|
* | <93b5982> 2012-06-08 [yaoyangyong] 3line
| * <4400260> 2012-06-08 [yaoyangyong] cherry-pick
* | <233d6f2> 2012-06-08 [yaoyangyong] 2nd line comment
* | <60d6edc> 2012-06-08 [yaoyangyong] modify hello,add one line
|/
* <aeae413> 2012-06-08 [yaoyangyong] add hello file
- 6
作为比较,我重新创建了一个干净的文件夹,其版本树非常简单,如下所示,然后我进行了 rebase,它是成功的。
* <0d63388> 2012-06-09 [yaoyangyong] (joy) add two lines
* <1f9d2f4> 2012-06-09 [yaoyangyong] (HEAD, master) add hello file