繁體中文 /
English
journal
album
book
about
Subscribe
Activities Elsewhere
This page is not available in 繁體中文, as a result the English (en_US) version is shown instead.
Title:
Body:
> **Update**: I've since written a script that automates this, see the follow up [ Fetching svn branches with git-svn ](http://hxbc.us/journal/+post/91/). > > The git-svn man page is less than helpful about how to track 2 subversion branches (actually, trunk and another branch). Typically trunk is the development branch and you have another branch for release that you backport fixes to. You can fetch all branches easily, but many times you don't want to and just want a particular branch. After many tries I've found something that works. > > After you cloned a git-svn repository, you should have something like this in your .git/config: > > [svn-remote "svn"] > url = svn://svn/mgmt/trunk > fetch = :refs/remotes/git-svn > > Append the branch that you want: > > [svn-remote "foo"] > url = svn://svn/mgmt/branches/foo_branch > fetch = :refs/remotes/git-foo > > Then do: > > git svn fetch -R foo -r 31144 # or whatever revision you want to start with > git branch -av # should see a new remote branch > git branch --track foo_branch git-foo > > After you do this, you should see your .git/config now has a new entry: > > [branch "foo_branch"] > remote = . > merge = refs/remotes/git-foo > > git svn rebase your new branch: > > git checkout foo_branch > git svn rebase > > Now you can cherry-pick revisions from foo_branch, and dcommit as usual.