Administrator@CeaserWang MINGW64 /e/Study/git_rebase (test) $ git rebase dev First, rewinding head to replay your work on top of it... Applying: [test branch] add -test1- in text.txt //将test的第一次提交应用到dev的最后一个节点 error: Failed to merge in the changes. Using index info to reconstruct a base tree... M test.txt Falling back to patching base and 3-way merge... Auto-merging test.txt CONFLICT (content): Merge conflict in test.txt Patch failed at 0001 [test branch] add -test1- in text.txt The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git rebase --continue". If you prefer to skip this patch, run "git rebase --skip" instead. To check out the original branch and stop rebasing, run "git rebase --abort".
Administrator@CeaserWang MINGW64 /e/Study/git_rebase (test|REBASE 1/2) $ cat test.txt master1 <<<<<<< HEAD dev1 dev2 ======= test1 >>>>>>> [test branch] add -test1- in text.txt Administrator@CeaserWang MINGW64 /e/Study/git_rebase (test|REBASE 1/2) $ git status rebase in progress; onto f28df0d You are currently rebasing branch 'test' on 'f28df0d'.//对dev 的'f28df0d'应用补丁。 (fix conflicts and then run "git rebase --continue") (use "git rebase --skip" to skip this patch)//使用dev的补丁,废弃test的修改。 (use "git rebase --abort" to check out the original branch)//终止rebase过程
Unmerged paths: (use "git reset HEAD <file>..." to unstage) (use "git add <file>..." to mark resolution)
both modified: test.txt
no changes added to commit (use "git add" and/or "git commit -a")
git rebase –abort的意思是终止当前rebase的操作,回到原始状态。
1 2 3 4 5 6 7 8 9
Administrator@CeaserWang MINGW64 /e/Study/git_rebase (test|REBASE 1/2) $ git rebase --abort
Administrator@CeaserWang MINGW64 /e/Study/git_rebase (test) $ git rebase dev First, rewinding head to replay your work on top of it... Applying: [test branch] add a line in test.txt error: Failed to merge in the changes. Using index info to reconstruct a base tree... M test.txt Falling back to patching base and 3-way merge... Auto-merging test.txt CONFLICT (content): Merge conflict in test.txt Patch failed at 0001 [test branch] add a line in test.txt The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git rebase --continue". If you prefer to skip this patch, run "git rebase --skip" instead. To check out the original branch and stop rebasing, run "git rebase --abort".
Administrator@CeaserWang MINGW64 /e/Study/git_rebase (test|REBASE 1/2) $ cat test.txt master1 <<<<<<< HEAD dev1 dev2 ======= test1 >>>>>>> [test branch] add a line in test.txt
test.txt文件里边的冲突部分是dev分支的“dev1 dev2”2行和test分支的“test1”, 即以dev的2次提交为基准,那么如果执行git rebase –skip所做的操作是: 丢弃test的第一次提交的修改,保留dev的修改:
Administrator@CeaserWang MINGW64 /e/Study/git_rebase (test|REBASE 1/2) $ git rebase --skip Applying: [test branch] add -test2- in text.txt //应用test的第二次提交。 error: Failed to merge in the changes. Using index info to reconstruct a base tree... M test.txt Falling back to patching base and 3-way merge... Auto-merging test.txt CONFLICT (content): Merge conflict in test.txt Patch failed at 0002 [test branch] add -test2- in text.txt The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git rebase --continue". If you prefer to skip this patch, run "git rebase --skip" instead. To check out the original branch and stop rebasing, run "git rebase --abort".
Administrator@CeaserWang MINGW64 /e/Study/git_rebase (dev) $ git add test.txt warning: LF will be replaced by CRLF in test.txt. The file will have its original line endings in your working directory.
Administrator@CeaserWang MINGW64 /e/Study/git_rebase (dev) $ git add test.txt warning: LF will be replaced by CRLF in test.txt. The file will have its original line endings in your working directory.
Administrator@CeaserWang MINGW64 /e/Study/git_rebase (test) $ git add test.txt warning: LF will be replaced by CRLF in test.txt. The file will have its original line endings in your working directory.
Administrator@CeaserWang MINGW64 /e/Study/git_rebase (test) $ git add test.txt warning: LF will be replaced by CRLF in test.txt. The file will have its original line endings in your working directory.
Administrator@CeaserWang MINGW64 /e/Study/git_rebase (test) $ git rebase dev First, rewinding head to replay your work on top of it... Applying: [test branch] add -test3- in test.txt error: Failed to merge in the changes. Using index info to reconstruct a base tree... M test.txt Falling back to patching base and 3-way merge... Auto-merging test.txt CONFLICT (content): Merge conflict in test.txt Patch failed at 0001 [test branch] add -test3- in test.txt The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git rebase --continue". If you prefer to skip this patch, run "git rebase --skip" instead. To check out the original branch and stop rebasing, run "git rebase --abort".