I'm working with an SVN repository that is laid out like this:
$SVN/[project]/trunk $SVN/[project]/branches/[user]/[branch] $SVN/[project]/tags/releases/[tag]
My .git/config looks like this:
[svn-remote "svn"] url = $SVN fetch = project/trunk:refs/remotes/trunk branches = project/branches/*/*:refs/remotes/*
When I look at git branch -a, I see all the remote branches. Let's say I want to check one out, work on it, then commit the changes back. Here's is what I am trying to do:
git checkout -b comments erik/comments .... work, commit locally .... git svn dcommit
However, dcommit always pushes to $SVN/project/trunk. git svn info
always reports the URL as $SVN/project/trunk
I've tried using --track, I've tried reseting with --hard. I'm out of ideas here. I suspect it's my [svn-remote], but that's just a hunch.
Does the branch erik/comments
exist in SVN already?
I work as follows:
git svn fetch #update any newly created branches
git checkout davec/new-feature # on remote branch, git may warn you
git checkout -b new-feature davec/new-feature # assumes this exists in SVN
# hack
# commit
git svn dcommit
I realize that git checkout -b local remote
is a one-step version of what I do in two steps, however this seems to work.
Another option is to replace your config with your username, e.g.
branches = project/branches/erik/*:refs/remotes/*
And then
git checkout new-feature # remote branch
git checkout -b new-feature-branch # local
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With