Git svn clone 具有奇怪的目录层次结构

发布于 2024-10-20 18:06:27 字数 968 浏览 4 评论 0原文

我们有一个 SVN 存储库,其结构如下:

https://xxxxxx.com/svn/foo/project/trunk/app/STUFF_I_WANT
https://xxxxxx.com/svn/foo/project/branches/dev/BRANCH_NAME/bar/STUFF_I_WANT

STUFF_I_WANT 自然是我想要的东西。主干中的 STUFF_I_WANT 遵循与分支中的 STUFF_I_WANT 相同的层次结构。 BRANCH_NAME 是可变的。 “bar”目录始终存在于任何分支中——换句话说,与主干中的“app”目录不同,分支中项目的父文件夹称为“bar”。另外,“bar”内可能还存在一些其他不相关的子目录。

我可以检查树干和各个树枝。然而,我完全无法在检查树干的同时仍然允许它跟踪树枝。我尝试了许多不同的命令,但它们最终都给了我一个只有零或一个提交的存储库。控制台上不断打印的主要错误是“无法找到 revmap”。

我已经尝试了 git svn init/clone 的以下所有变体,但均无济于事——它们都产生与我上面提到的相同的结果。

git svn clone -$(svn log -q --limit 1 $SVN_URL | awk '/^r/{print $1}') $SVN_URL -T trunk/app -b branches/dev/*/bar

git svn clone -$(svn log -q --limit 1 $SVN_URL | awk '/^r/{print $1}') $SVN_URL -T trunk/app -b branches/dev

git svn init $SVN_URL -T trunk/app -b branches/dev

最后一个,我随后编辑 .git/config 以拥有 branches = ipssdt/branches/dev//ccix:refs/remotes/ 但它不起作用任何一个。

We have an SVN repository that has the following structure:

https://xxxxxx.com/svn/foo/project/trunk/app/STUFF_I_WANT
https://xxxxxx.com/svn/foo/project/branches/dev/BRANCH_NAME/bar/STUFF_I_WANT

STUFF_I_WANT is, naturally, the stuff I want. The STUFF_I_WANT in the trunk follows the same hierarchy as the STUFF_I_WANT in the branches. BRANCH_NAME is variable. The "bar" directory is always there in any branch--in other words rather than "app" like in the trunk, the parent folder of the project in the branch is called "bar". In addition, there may be a number of other unrelated subdirectories inside "bar".

I can check out the trunk, and individual branches just fine. However, I'm totally stumped on checking out the trunk while still allowing it to track the branches. I've tried a number of different commands, but they all end up giving me a repo with just zero or one commits inside. The main error that keeps getting printed to the console is "Couldn't find revmap".

I've tried all of the following variations on git svn init/clone, to no avail--they all yield the same results I mentioned above.

git svn clone -$(svn log -q --limit 1 $SVN_URL | awk '/^r/{print $1}') $SVN_URL -T trunk/app -b branches/dev/*/bar

git svn clone -$(svn log -q --limit 1 $SVN_URL | awk '/^r/{print $1}') $SVN_URL -T trunk/app -b branches/dev

git svn init $SVN_URL -T trunk/app -b branches/dev

That last one, I followed up by editing .git/config to have branches = ipssdt/branches/dev//ccix:refs/remotes/ but it didn't work either.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

榆西 2024-10-27 18:06:27

尝试一下,

git svn init $SVN_URL -T trunk/app -b 'branches/dev/*/bar'

我不确定它会做正确的事情,所以然后转到 .git/config 并检查选项。我相信它们应该是:

fetch = trunk/app:refs/remotes/trunk
branches = branches/dev/*/bar:refs/remotes/branches/*

文档明确指出 * 在 subversion 分支路径内的任何位置都受支持,而不仅仅是在末尾,但您仍然必须指定分支的确切路径 - git svn 可以'不要猜测该分支实际上位于您指定的子目录中。

Try

git svn init $SVN_URL -T trunk/app -b 'branches/dev/*/bar'

I am not sure it will do the right thing, so then go to the .git/config and check the options. I believe they should be:

fetch = trunk/app:refs/remotes/trunk
branches = branches/dev/*/bar:refs/remotes/branches/*

The documentation explicitly says that * is supported anywhere inside the subversion branch path, not just at the end, but you still have to specify exact path to the branch—git svn can't guess that the branch is actually in a subdirectory of what you specified.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文