I use git rebase --onto target source foo to move the branch foo from the branch source onto the branch target. Do you know if it is possible to use hash values instead of branch names (if not given) like this: git rebase --onto ab91c f4242 foo?
As a workaround I temporarily added branch names to the relevant commit objects. But this can be a pita if you have many branches to being rebased.
Example situation:
° bb42a
° ab91c
° 979c2
/° fb648 foo
° f4242 --
° 333c9
After git rebase --onto ...
° bb42a
/° fb648 foo
° ab91c --
° 979c2
° f4242
° 333c9
Background:
The explained problem is very common if you use an svn-server as you remote repository. All you commit objects get rewritten since the svn-id will be added every time you git svn dcommit to the svn-repository. This detaches all other branches from their former master.