通过 Tortoise SVN shell 菜单通过通配符排除文件
我在 Windows 7 中使用 Tortoise SVN 1.6.16。如果我想从将来的提交中排除某种文件类型,我想我可以在我的工作文件夹中找到该类型的文件,然后右键单击它,然后选择“TortoiseSVN->删除并添加到忽略列表->*.ext”,其中ext是我单击的文件的文件扩展名,如下图所示。
但是,当我这样做时,它仅排除该特定文件,并且下次提交时,该类型的所有其他文件仍会出现在要提交的列表中。
我做错了什么吗?我怎样才能告诉 Tortoise 或 SVN 在未来的提交中忽略某种类型的所有文件?
I am using Tortoise SVN 1.6.16 in Windows 7. If I have a certain file type I want to exclude from future commits, I thought I could just go find a file of that type within my working folder, then right click it, and select "TortoiseSVN->Delete and Add to Ignore List->*.ext" where ext is the file extension of the file I clicked, as shown in the image below.
However, when I do this, it only excludes that specific file, and the next time I commit, all other files of that type still come up in the list to commit.
Am I doing something wrong? How can I just tell Tortoise or SVN to ignore all files of a certain type from future commits?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我和@Stefan 有同样的预感:您可能会看到子目录中的文件,并认为这些文件也应该被忽略,即使您只将忽略应用于单个文件夹。
因此,如果事实确实如此,则方法如下:
当您想要忽略单个目录中的文件或模式时:
使用便捷菜单命令添加到忽略列表。
当您想要忽略子树中的文件或模式时:
打开子树根的 subversion 属性 (
TortoiseSVN >> 属性
)。添加或编辑svn:ignore
关键字的条目。该插图显示了一个示例,其中我指定忽略obj
子文件夹以及具有.user
或.bak
扩展名的所有文件。秘密就在规范中——当您定义要忽略的模式时,请选择递归选择如下所示:
不幸的是,此方法有一个问题:在我的示例中,我之前指定忽略
obj
和*.user
,我只添加了*.bak
模式。当我递归应用时,它不仅仅应用更改 (*.bak),而是应用 svn:ignore 关键字中的所有内容(obj、*.user 和 *.bak) ) 到所有子文件夹。这可能是你想要的,也可能不是你想要的,所以要注意这一点。I had the same hunch as @Stefan: that you were probably seeing files in subdirectories and thinking those should have also been ignored even though you only applied the ignore to a single folder.
So if that is in fact the case, here is the recipe:
When you want to ignore files or patterns from a single directory:
Use the convenience menu command to add to the ignore list.
When you want to ignore files or patterns from a subtree:
Open the subversion properties (
TortoiseSVN >> Properties
) of the root of the subtree. Add or edit an entry for thesvn:ignore
keyword. The illustration shows an example where I have specified to ignore anobj
subfolder as well as all files with a.user
or.bak
extension.The secret, though, is in the specification--when you define the patterns to ignore, select the recursive choice as indicated here:
Unfortunately, there is one catch to this method: In my example, I had previously specified to ignore
obj
and*.user
and I was adding just the*.bak
pattern. When I apply recursively, it does not apply just the change (*.bak) but everything in the svn:ignore keyword (obj, *.user, and *.bak) to all subfolders. That may or may not be what you want, so be aware of it.它会正确忽略所有bat文件,但不会递归!它只会忽略您将其添加到忽略列表的文件夹中的它们。
It ignores all bat files right, but not recursively! It only ignores them in the folder you added it to the ignore list.
您还可以使用 Tortoise 的全局忽略模式(如果它适用于您的所有工作副本):
You could also use Tortoise's global ignore pattern (if it's applicable to all your working copies):