| ▲ | jolmg 3 hours ago | |||||||||||||||||||||||||
> I'll end up with this state, where `E` remains untouched? Can't, because a commit's hash takes into account the parent hashes. Haven't used --update-refs, but reading it, it should result in your third graph. So, > is there a way to get `git rebase` to have the same behavior? is already the case. | ||||||||||||||||||||||||||
| ▲ | seba_dos1 2 hours ago | parent | next [-] | |||||||||||||||||||||||||
It won't result in the third graph on its own as E isn't reachable from D, but it could if you first merged D and E together and then used --update-refs with --rebase-merges. You could then just discard the merged branch and only take care of D' and E' on their own (and since you don't care about the merged branch, you don't have to care about resolving conflicts while preparing it either). | ||||||||||||||||||||||||||
| ▲ | shepmaster 3 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||
> Haven't used --update-refs, but reading it, it should result in your third graph. I don't think it does. I tried locally:
And ended up with this graph (`git log --graph --all`)
Replacing the `git commit -m 'fix b'; git rebase -i --root --update-refs` with `git history fixup HEAD~` produces what I'd like: | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
| ▲ | rmunn 3 hours ago | parent | prev [-] | |||||||||||||||||||||||||
Unless E remained untouched because it was not rewritten, and ended up staying parented on B instead of getting reparented onto B'. Which is usually not what you want; most of the time you want E', which is E reparented onto B'. But sometimes you want E to remain untouched and stay parented on the original B. Depends on the situation. | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||