I am one of the current maintainers of the FreeGLUT project on sourceforge. This code is stored in an SVN repo, but to stimulate contributions of others, I want to make a git repo available. I already have a git-svn clone of the svn trunk up on github currently at github (made through SmartGit, which is not really compatible with git-svn actually).
I made this by cloning https://svn.code.sf.net/p/freeglut/code/trunk/freeglut
. However, I now find that I should have cloned https://svn.code.sf.net/p/freeglut/code
and have SmartGit's svn bridge figure out the branches and trunk.
I have made this new correct clone locally. Now the problem: I already have a few commits in my local git repo of the old/wrong clone. I would like to transfer these over to my new repo, but as the root directories on disk are not the same, a simple rebase strategy as outlined here would not work (I think).
I could do it with patches, as git apply
has the --directory
argument to prefix the paths in the patch files that would make things work, but then I would have to do it commit by commit. At least, I have not found a way to put multiple commits in a single patch file (without squashing) and replay them all on top of my HEAD
.
How to I best solve my problem?
Ok, it turns out that:
git format-patch
can generate a file containing a range of commits, such as a whole branch.git am
with the --directory
option can replay the commits contained in the patch file one by one (see here) and commit them for me.Problem solved!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With