Re: git-svn branch naming question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Dec 08, 2007 at 03:14:49PM +0100, Miklos Vajna wrote:
> On Sat, Dec 08, 2007 at 11:59:01AM +0100, Peter Baumann <waste.manager@xxxxxx> wrote:
> > Look up  --prefix in the manpage for git-svn.
> 
> great, --prefix is what i missed.
> 
> a related question: is it possible to avoid even the "remotes" prefix?
> 
> it could be useful when creating an incremental import of an svn repo.
> (ie when using git-svn as a replacement of git-svnimport.)
> 

git svn init --stdlayout creates this entry in your .git/config per default

  [svn-remote "svn"]
        url = https://url/to/your/svn/repo
        fetch = trunk:refs/remotes/trunk
        branches = branches/*:refs/remotes/*
        tags = tags/*:refs/remotes/tags/*

You could change this to

  [svn-remote "svn"]
        url = https://url/to/your/svn/repo
        fetch = trunk:refs/remotes/origin/trunk
        branches = branches/*:refs/remotes/origin/*
        tags = tags/*:refs/remotes/origin/tags/*

to get what --prefix origin would do.


 On the other hand you could forget completly the remote part by specifying

  [svn-remote "svn"]
        url = https://url/to/your/svn/repo
        fetch = trunk:refs/heads/trunk
        branches = branches/*:refs/heads/*
        tags = tags/*:refs/heads/tags/*

but I advice you to not do this. refs/remotes has a special meaning in git,
e.g.  you can't commit directly to it (which makes sense, because it only
tracks the state of the remote repo. On the other hand remote branches won't
get cloned per default.)

Side note, if you want to track only some branches, or if you have a strange
svn layout, you could use something like this:

  [svn-remote "svn"]
        url = https://url/to/your/svn/repo
        fetch = trunk:refs/remotes/origin/trunk
        fetch = branches/branchA:refs/remotes/origin/branchA
        fetch = branches/branchB:refs/remotes/origin/branchB
	...


-Peter
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux