简体   繁体   中英

Merge conflict when running 'git rebase'

I am on a developer branch, and I try to execute git rebase remote/a_remote_branch I see:

First, rewinding head to replay your work on top of it...
Applying: change #1
Failed to merge in the changes.
Patch failed at 0001 change #1

My question is why is git rebase trying to apply 'change #1'?

This is because when I do git log , I see 'change #1' in my local branch, why git trying to apply 'change #1' again when I rebase?

The difference between merge and rebase is that rebase is trying to make it look like you based your branch on a newer version of the parent branch. So it removes all of your branch commits, fast-forwards to the the latest parent commit, and then tries to re-apply your changes. Hence re- basing . If you merge it makes a new commit that pulls in all of the parent changes on top of your work. Then the conflicts (if any) will be in that merge commit rather than in your existing branch work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM