tags:

views:

355

answers:

1

After cloning an SVN repository using git-svn with the -s option (git svn clone http://server/repo -s), how does one create a branch or tag and have pushed to the relevant branch/tag directory in the repository when dcommiting?

For instance; if I were to use git to create a foobar branch locally (git checkout -b foobar) how can I have git-svn create the branch on the server (http://server/repo/branches/foobar)?

I'm using Git 1.5.5.6.


Please Note:

The accepted method below does not work with Git 1.5.5.6 as there is no git svn branch method. I'm still looking for a solution to this that doesn't involve resolving to working with svn directly.

+7  A: 

You can read all the nitty-gritty details in this tutorial, but the gist is basically the following:

$ git svn branch -m "Topic branch" my_topic            # Create SVN branch called "my_topic"
$ git checkout --track -b my-topic remotes/my_topic    # Create the Git branch for "my_topic"
# Hack hack hack...
$ git svn dcommit --dry-run    # Make sure you're committing to the right SVN branch
$ git svn dcommit              # Commit changes to "my_topic" branch in SVN
mipadi
This **doesn't** work with my git version of 1.5.5.6 - there is no such command `git svn branch`.
digitala
`git svn branch` was added in v1.6.1. I'd recommend upgrading, as 1.5.5.6 is about a year and a half old.
mipadi