On http://trac.webkit.org/wiki/UsingGitWithWebKit there is a very useful trick:
If you want to be able to commit changes to the Subversion repository, or just want to check out branches that aren’t contained in WebKit.git, you will need track the Subversion repository. To do that, inform git-svn of the location of the WebKit SVN repository, and update the branch that git-svn uses to track the Subversion repository so that it will re-use the history that we’ve already cloned from git.webkit.org rather than trying to fetch it all from Subversion:
1 | cd WebKit |
This will add the following section to your .git/config:
1
2
3[svn-remote "svn"]>
url = http://svn.webkit.org/repository/webkit
fetch = trunk:refs/remotes/origin/master
You can then run the following command to have git-svn rebuild its metadata from your local repository, and to pull any recent commits from the WebKit SVN repository.
1 | git svn fetch |
So, let’s say you have a subversion repository:
1 | svn://svn.openwrt.org/openwrt/trunk |
and you also have a git clone of that repository:
1 | git://nbd.name/openwrt.git |
(Obviously these examples come from OpenWrt)
Now if you don’t want to fetch the whole history from svn, which will take forever, here is what you can do:
1 | mkdir openwrt;cd openwrt; |
- The
git config
line tells git-svn to use the history in nbd.name, so you won’t need to checkout the same commits from svn. - Use
--prefix=svn/
to separate nbd.name upstream and svn upstream.