git: replay commits on a different path
I’ve done a couple commits in “somedir” and have been continuously rebasing while I worked—my history is linear. Now I wish I hadn’t done my work in “somedir”, but in a separate copy. Can I replay my commits on “anotherdir”, which is an identical copy of “somedir”?
(My commits are on a local topic branch, but that’s not essential to the question.)
One Solution collect form web for “git: replay commits on a different path”
You can add
anotherdir as a remote of
somedir, and push your changes.
somedir, assuming the branch with your changes is called
git remote add anotherdir /path/to/anotherdir git push anotherdir current
anotherdir you can checkout the branch