通过 Tortoise SVN shell 菜单通过通配符排除文件

发布于 2024-11-27 20:34:59 字数 351 浏览 1 评论 0原文

我在 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?

enter image description here

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

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

发布评论

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

评论(3

暖伴 2024-12-04 20:34:59

我和@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 the svn:ignore keyword. The illustration shows an example where I have specified to ignore an obj subfolder as well as all files with a .user or .bak extension.

enter image description here

The secret, though, is in the specification--when you define the patterns to ignore, select the recursive choice as indicated here:

enter image description 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.

眼眸里的快感 2024-12-04 20:34:59

它会正确忽略所有bat文件,但不会递归!它只会忽略您将其添加到忽略列表的文件夹中的它们。

It ignores all bat files right, but not recursively! It only ignores them in the folder you added it to the ignore list.

梦纸 2024-12-04 20:34:59

您还可以使用 Tortoise 的全局忽略模式(如果它适用于您的所有工作副本):

  • TortoiseSVN ->设置
  • 常规
  • 填写“全局忽略模式”字段,例如在其末尾添加“*.ext”,用空格分隔条目。

You could also use Tortoise's global ignore pattern (if it's applicable to all your working copies):

  • TortoiseSVN -> Settings
  • General
  • Fill out the "Global ignore pattern" field, such as adding "*.ext" at the end of it, separating entries with a space.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文