I am trying to figure out the working mechanism of git-rebase
. Documentation provides information about what git-rebase
does, but doesn't comment on how it does?
I have looked into the source code, worked out some test cases and so far understand following:
1. Git maintains the state of rebase in .git/rebase-apply
(with files like patch, final-commit, head-name etc)
2. Git uses git-format-patch
to create all necessary patch files (which are inside rebase-apply)
3. Git uses git-am
to apply those patches one by one
I think I am missing quite a lot of details. Where can I find the implementation details? Is it simply dumping the patch and naively applying it?