#! /bin/sh set -eux git init test cd test echo a > file git add . git commit -m a git branch -t test echo b > file git add . git commit -m b git checkout test echo c > file git add . git commit -m c ! git rebase git checkout --theirs . git add . git rebase --continue