开发者

git-svn branching: how to configure git config

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:

branc开发者_JAVA技巧hes = 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


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).


This was a post that helped me get git working with svn with a project that had a very unorthodox branch stucture (which is par for the course for companies using SVN for some reason I'm afraid).

http://www.dmo.ca/blog/20070608113513/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜