#!/bin/sh
mkdir t
cd t
git init

touch common1 && git add common1 && git commit -m common1
touch common2 && git add common2 && git commit -m common2

git checkout -b dest
touch newbase && git add newbase && git commit -m newbase
touch newbase2 && git add newbase2 && git commit -m newbase2

git checkout master
touch this_gets_lost && git add this_gets_lost && git commit -m this_gets_lost
touch this_too && git add this_too && git commit -m this_too

git checkout -b new
git rebase --onto dest master new

echo "master's shortlog"
git shortlog master
echo "rebased new shortlog"
git shortlog
