使用git-svn处理具有非标准布局的SVN存储库

时间:2013-11-28 04:04:13

标签: git svn git-svn

我正在使用此布局处理SVN仓库/path/to/svn/repo

|--aaa/ #empty
|--branches/ #currently on r35, continuing...
|--|--file1
|--|--file2
|--|--file3
|--|--dir1/
|--|--dir2/
|--|--dir3/
|--tags/ #empty
|--trunk/ #empty

我使用这个命令:

$ git svn clone -s /path/to/svn/repo
#some outputs...
#git checkout master to track r1 (or something like that).

然后我得到一个目录repo,其中只包含.git/

git branch -ra输出:

* master
  remotes/dir1
  remotes/dir2
  remotes/dir3
  remotes/trunk

现在我可以结帐dir1dir2dir3,但没有file1file2file3等。

如何检查branches/目录下的目录作为整个分支?也就是说,如何使用git-svn与仍在使用SVN的其他人一起工作?

./git/config的一部分:

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

1 个答案:

答案 0 :(得分:0)

所以,我理解它的方式svn存储库中的/ branches文件夹不包含分支列表,而是代码的副本,这是所有开发发生的位置?

如果我的上述假设是正确的,我建议尝试以下方法。

执行以下命令(尽管根据您的条件进行调整):git svn clone "http://svn-server.local/path_to_repository" "my_git_repository" --authors-file="users.txt" --trunk="branches" --no-metadata

现在,为什么不将“trunk”指向SVN存储库的主干?根据你的问题,该文件夹似乎是空的,因此没有任何重要性。

相关问题