我想要一个存储库完全忽略某些文件 - 相当于将这些文件添加到 git 系统中的 .gitignore 。我试过:
svn propset svn:ignore *.aux" .
忽略所有
.aux
文件。但是,在这样做之后并成功svn commit
, svn status
仍然显示:? something.aux
! somethingelse.aux
有没有更强大的方法告诉它忽略这些文件,这样它们就不会出现在这样的列表中?
最佳答案
这实际上是一个常见问题,我强烈建议您考虑 SVNBook 章节 "Ignoring Unversioned Items"涵盖它。
请参阅解释行为的 SVNBook 的重要摘录:
Subversion's support for ignorable file patterns extends only to the one-time process of adding unversioned files and directories to version control. Once an object is under Subversion's control, the ignore pattern mechanisms no longer apply to it. In other words, don't expect Subversion to avoid committing changes you've made to a versioned file simply because that file's name matches an ignore pattern—Subversion always notices all of its versioned objects.
根据
svn status
输出,您的工作副本包含 one unversioned item (the one with the '?' sign) and one missing item (the one with the '!' sign) .? something.aux
! somethingelse.aux
所以你已经手动删除了(即通过 Windows 资源管理器,但不是通过 SVN 客户端)
somethingelse.aux
现在它处于“失踪”状态。另一个文件 something.aux
仍然没有版本化并且是 不是 忽略。如果您没有输入错误
svn propset
命令,提交了属性更改并且文件仍然处于未版本化状态,您可能会发现此摘录很有帮助:the patterns found in the svn:ignore property apply only to the directory on which that property is set, and not to any of its subdirectories.
此外,您可以查看
svn:ignore
属性(property)通过发行 svn propget
命令。
关于SVN不忽略文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9446635/