➜ git_cherry_pick git:(master) git cherry-pick 0318ff6fd8b6f76 error: could not apply 0318ff6... hello4 hint: after resolving the conflicts, mark the corrected paths hint: with 'git add <paths>' or 'git rm <paths>' hint: and commit the result with 'git commit' ➜ git_cherry_pick git:(master) ✗ cat test.txt hello hello1 <<<<<<< HEAD ======= hello2 hello3 hello4 >>>>>>> 0318ff6... hello4
➜ git_rebase git:(test) git rebase develop First, rewinding head to replay your work on top of it... Applying: add test1 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 error: Failed to merge in the changes. Patch failed at 0001 add test1 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".
如果执行git rebase --skip,就会丢弃掉test分支上提交的修改,直接使用develop上的内容。
1 2 3 4 5 6 7 8 9 10 11 12 13 14
➜ git_rebase git:(f1e1d6a) ✗ git rebase --skip Applying: add test2 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 error: Failed to merge in the changes. Patch failed at 0002 add test2 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".
因为有2次提交,所以忽略第一次后,还有第二次的内容
1 2 3 4 5 6 7 8 9 10
➜ git_rebase git:(f1e1d6a) ✗ cat test.txt hello <<<<<<< HEAD world develop1 ======= test1 test2 >>>>>>> add test2