a few months ago i configured a git with an svn repository. Until now i only used the svn repository to keep up-to-date with the supplied application on it. But now i also want to commit stuff back. To do this every feature i'm going to commit needs to be in a separate branch. I read about how you should create a new branch etc. But i think i mis-configured my git, i don't have any branch information etc i think i only have the trunk info. This is how my svn repository has been set up in my git config:
[remote "origin"]
url = url-of-git-repository
fetch = +refs/heads/*:refs/remotes/origin/*
[svn-remote "svn"]
url = url-of-svn-repository/trunk
fetch = :refs/remotes/git-svn
[branch "master"]
merge = refs/heads/master
remote = origin
... other branch information below (these are git branches)
Now as you can see my svn-remote url goes directly to trunk. I read about adding this:
branches = branches/*:refs/remotes/*
but when i create a new branch then it will be adding it to trunk/branches/. When i don't add the line then it doesn't know what the destination is of the branch.
Any idea how to solve this without breaking the existing branches, code, etc.?
greets, Daan
git-svn is a specialized tool for Git users to interact with Git repositories. It works by providing a Git frontend to an SVN backend. With git-svn, you use Git commands on the local repository, so it's just like using normal Git. However, behind the scenes, the relevant SVN commands are sent to the server.
Subversion Branching StrategiesSubversion branches (SVN branches) allow your team to work on multiple versions of your code simultaneously. Developers can test out new features without impacting the rest of development with errors and bugs. SVN's “branch” directory runs parallel to the “trunk” directory.
TortoiseGit Is an easy to use gui-based git client for windows. With the included git-svn module it is also possible to use subversion repositories. If you use git locally, you can use all git features like stashing and local branches but still use the subversion repository.
I believe the branches configuration is relative to the svn-remote url.
Here's our configuration the way it was made by doing
git svn -s url-of-svn-repository/foo
(Inside the folder foo, we have the normal trunk/branches/tags structure)
[svn-remote "svn"]
url = url-of-svn-repository
fetch = foo/trunk:refs/remotes/trunk
branches = foo/branches/*:refs/remotes/*
tags = foo/tags/*:refs/remotes/tags/*
You could try adjusting to this structure, or do your git svn clone over again with the -s parameter. It will configure all this for you (--standard-layout).
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