Merge branches one by one, use git-rerere autoupdate
Change flow control logic, add comments