I have a git repository which tracks an svn repository. I cloned it using --stdlayout
.
I created a new local branch via git checkout -b foobar
Now I want this branch to end up in …/branches/foobar
in the svn repository.
How do I go about that?
(snipped lots of investigative text. see question history if you care)
@kch I just (7 December 2008) compiled the v1.6.1-rc1 tag of git and it does contain the git svn branch command and the documentation for it. So the v1.6.1 release of git should (hopefully) contain this command.
I know this question has been answered a while ago, but after reading it, I it might help adding examples of the specific git svn branch command and relate it to a typical workflow.
Like kch answered, use
git svn branch
. Here is a full example, (note the-n
for dry-run to test):If this goes well, server replies with answer like this:
And without the
-n
switch the server probably adds something like:The best part of it, now you can create a local branch based on your remote branch like so:
Which means "check out and create local branch named
auth_bug
and make it follow the remote branch (last parameter)auth_bug
Test that your local branch works on that remote branch by using
dcommit
with--dry-run
(-n
):And SVN server should reply with the new branch name:
as of git v1.6.1,
git svn branch
is available.From the git docs:
Previous versions of git do not provide a way to create an svn branch.