SVN不忽略文件

标签 svn version-control svnignore

我想要一个存储库完全忽略某些文件 - 相当于将这些文件添加到 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/

相关文章:

apache - apache svn 版本 6.0.38 与 6.0.389418 有什么区别

git - 用于备份的私有(private) mercurial/git 分支?

svn - 在使用 git 和 git-svn 桥接器时,如何指示要在 svn 中忽略的文件?

git-svn - 使用 git-svn 时,.gitignore 中的条目是否会应用于 SVN 存储库?

svn - 如何 check out SVN 存储库,覆盖非版本化本地目录?

git - 将 SVN 仓库拆分成几个 Git 仓库

git - 是否可以检测站点是否正在使用版本控制系统

svn - 如何在 Vista 上的 VisualSVN Server 上迁移所有源代码并迁移到 Windows 7?

ssl - Subversion 结帐无法通过 HTTPS Ubuntu 16.04 在终端中工作

svn - 可以通过右键菜单忽略 RabbitVCS 中的文件吗?