git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: how to fetch a new svn branch after clone?

From
Changsheng Jiang <jiangzuoyan@gmail.com>
Date
Jul 17, 2009, 02:00 UTC
Message-ID
<eafc0afe0907161900k35b2dff1u5a2bfc574bb93231@mail.gmail.com>
In-Reply-To
<4A5F8CDA.5080202@xiplink.com>
Thank Marc.

You are right, it should be the latter case with url http://www.example.com/project/branches/test

But "git svn clone" has already added these lines to .git/config
[svn-remote "svn"]
	url = https://xxx.xxxx.com/svn/xxx
	fetch = trunk:refs/remotes/trunk
	branches = branches/*:refs/remotes/*
	tags = tags/*:refs/remotes/tags/*
And it still can not fetch new branch.
                                                      Changsheng Jiang
On Fri, Jul 17, 2009 at 04:26, Marc Branchaud<marcnarc@xiplink.com> wrote:
Show 44 quoted lines
> The latest 1.6.4-rc1 contains patches to git-svn for it to support more than one branch URL in an svn repository.
>
> However, before I describe that, can you confirm whether your new branch is in fact named
>
>        http://svn.example.com/project/test
>
> or is it really
>
>        http://svn.example.com/project/test/<branchname>
>
> Because if it's the former then I'm not sure if git-svn can handle your new branch.  The problem is that even though the branch is named 'test' it's a sibling to the 'branches' 'tags' and 'trunk' paths in the repository.  For git-svn to pick up branches, you point it at the path *containing* the branch names.  In the former case, to pick up project/test as the 'test' branch you'd have to point git-svn at the project directory, and that would cause it to also pick up project/tags, project/branches, and project/trunk as other branches (named 'tags', 'branches' and 'trunk').
>
> However, in the latter (test/<branchname>) case, with 1.6.4, I *think* git-svn will pick up the new branches under test if you add a new 'branches' line to the svn-remote's section in your .git/config file.  Something like
>
>        branches = test/*:refs/remotes/*
>
> might let you see the new branches.  The reason I can't be more certain is that if you've done a 'git svn fetch' since the branch was created then git-svn might not pick up the branch-creation commits later.  Unfortunately I don't know git-svn well enough to say for certain.
>
>                M.
>
>
> Changsheng Jiang wrote:
>> Hi list,
>>
>> I know how to clone a svn repository with all branches and tags at the
>> initial step, but I find no answers of how to fetch a new svn branch
>> after clone.
>>
>> For example, this
>>
>> git svn clone http://svn.example.com/project -T trunk -b branches -t tags
>>
>> will clone all branches. but that clone, the svn repository has a new
>> branch test with url http://svn.example.com/project/test, how to clone
>> it as the initial step?
>>
>> Thanks.
>>
>>                                                      Changsheng Jiang
>> --
>> To unsubscribe from this list: send the line "unsubscribe git" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
Previous: Marc BranchaudNext: Marc Branchaud
Message 3 of 5 in “how to fetch a new svn branch after clone?”
  1. Changsheng JiangJul 16, 2009
  2. Marc BranchaudJul 16, 2009
  3. Changsheng JiangJul 17, 2009
  4. Marc BranchaudJul 17, 2009
  5. Changsheng JiangJul 17, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.