rewriteBranch should work now
Glue it together a bit