gpt4 book ai didi

Git-svn W : -empty_dir warnings. 它们是什么意思?

转载 作者:IT王子 更新时间:2023-10-29 00:54:55 26 4
gpt4 key购买 nike

在尝试使用标准布局使用 git-svn 克隆现有的 Subversion 存储库时,我收到了一堆 W: -empty_dir(和 W: +empty_dir)警告.克隆的 git 存储库似乎可以正常工作,即我可以执行常规的 git 操作并提交到 SVN 存储库。

真正的问题是初始克隆和 rebase 创建了一些空目录,这些目录在 SVN 存储库中不存在,位于存储库的顶部(以及主干中的其他目录)。这些目录不包含文件,只包含其中的一些空目录。似乎“W: -empty_dir”警告对应于这些空目录。

我通过使用 SVN 检查整个存储库来查找空目录,但没有空目录。我还通过 SVN 检查了存储库是否包含具有特殊属性的文件,但除了“可执行文件”和“mime 类型”之外没有其他文件。

现有的存储库最初并不遵循标准布局,但我清理了它,使顶级目录只是“trunk”、“tags”和“branches”。

是什么导致创建这些在 Subversion 下不存在的空目录?

最佳答案

如果不知道这些空目录的确切来源,您可以使用 --rmdir 命令行选项或 svn 告诉 git-svn 删除它们.rmdir 配置选项。

参见 git-svn OPTIONS手册页和

Remove directories from the SVN tree if there are no files left behind.
SVN can version empty directories, and they are not removed by default if there are no files left in them. git cannot version empty directories.
Enabling this flag will make the commit to SVN act like git.


警告来自 git-svn 不支持的 SVN 标签(即“目录”),如“git svn interrupted, then I lost all the tags, how to fix it?”。
From this thread :

SVN tracks directories, git doesn't, so empty directories cannot be represented in git.
Those warnings on files seem to tell you which files that got deleted, causing an empty directory to be left in place, in that particular svn commit being imported.

-empty_dir+empty_dir 的区别在于空目录在 SVN 仓库中的显示方式:

-empty_dir

一堆文件被删除,留下一个目录(分支或标签)为空。

+empty_dir

正在导入的 SVN 修订版中刚刚创建了一个空分支或标签,git-svn 不会导入一个空目录。


注意你can restart the import after that warning .

关于Git-svn W : -empty_dir warnings. 它们是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4147356/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com