I created a repository with git-svn from a big svn repository (git svn clone).
I’ve several local commits in my git repository that I don’t need to push to svn but I will need to get updates from it.
Now I realized that I don’t need the entire svn history in my local repository, since it’s using too much space (some Gb) and that I should have used the -r option in the clone command to select a starting point.
I’d linke to start over with a new repository and then merge all the local commits from the old repository, but I’m not sure there is a simple way to do this.
The situation is this:
log of the old repository:
- local commit 10
- local commit 9
… - local commit 1
- svn revision X
- svn revision X-1
… - svn revision 1
the new repository has just one commit, corresponding to the contend of the revision X of the svn repository.
I tried to use format-patch and apply commands but I’m not sure on how to do this.
Is there a way to do what I need?
Thanks for any help
One method is, in your new repository:
git remote add oldyour old repository;git fetch old;git rebase --onto.When done,
git remote rmthe old repo andgit gc.See
git help rebasefor the--ontooption: it is very, very useful.