Subversion svn:提交后忽略 - 文件不会被忽略

发布于 2024-10-10 13:16:53 字数 420 浏览 9 评论 0原文

我一直在尝试忽略特定的文件和目录,以防止本地修改被提交到存储库。

我遇到的问题是,一旦文件被提交到存储库,您就不能然后忽略它

svn propset svn:ignore '*' ./stuff

如果 ./stuff 文件夹中的文件已添加并提交,则将来提交时不会忽略它们。我发现我经常想在项目开始时忽略特定文件,但不能因为这些目录不是工作副本,所以我正在这样做,

svn add *
svn revert fileIWantToIgnore.ext
svn propset svn:ignore 'fileIWantToIgnore.ext' .

这是一个有点费力的过程。您有什么建议?

I've been trying to ignore particular files and directories in order to prevent local modifications being submitted to repository.

The problem I am having is that once a file has been committed to a repository, you cannot then ignore it.

svn propset svn:ignore '*' ./stuff

If the files in the ./stuff folder have already been added and committed, they are not ignored for future commits. I find I often want to ignore particular files at the beginning of a project but cannot as these directories are not working copies so i'm doing

svn add *
svn revert fileIWantToIgnore.ext
svn propset svn:ignore 'fileIWantToIgnore.ext' .

This is a bit of a laborious process. What would be your suggestions?

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

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

发布评论

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

评论(2

江湖正好 2024-10-17 13:16:53

删除您想要忽略但已提交的文件。
提交已删除文件的版本。
将文件恢复到源,并立即添加属性 svn:ignore。

它不干净但有用

Delete the files you wanted to ignore but were committed.
Commit the version with the files deleted.
Restore the files to your source, and add the property svn:ignore now.

It's not clean but useful

佞臣 2024-10-17 13:16:53

这就是它应该做的,但你可以尝试这些。

创建一个预提交挂钩脚本,该脚本在添加特定属性时拒绝提交。然后,您可以将此属性添加到工作副本中的文件以防止提交。

TortoiseSVN 将排除特殊变更列表“ignore-on-commit”中的文件。然而,SVN 命令行客户端不支持这一点。

SVN:有没有办法将文件标记为“不提交”?

That is what it is supposed to do, but you could try these.

Create a pre-commit hook script that reject the commit when a specific property is being added. You can then add this property to files in the working copy to prevent commits.

TortoiseSVN will exclude files in the special changelist "ignore-on-commit". However, this is not honored by the SVN command-line client.

SVN: Is there a way to mark a file as "do not commit"?

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