Monday, May 4, 2015

Git rebase (put your history on top of upsteam history)

Git rebase is usually needed when you want to push commits to the branch, but it is ahead of you and you don't want to add your merge messages to the branch history. Sort of bon ton. Rebase will replay your history on top of the branch. Workflow for git rebase:
git rebase [upstream/master]
If there are conflicts, resolve them by hand, or:
git checkout --ours (or --theirs) [filename]
git add [filename]
Continue:
git rebase --skip #if theirs (or --continue #if ours)

1 comment: