p4sync,如何在使用通配符时排除文件?
我正在尝试使用 p4sync 使用通配符将特定目录同步到给定的更改列表编号,但我也想排除该目录下(子目录中)的文件列表,我尝试使用 - (在使用之前和之后带通配符的路径),但文件永远不会被排除,这是我正在尝试的命令:
p4 sync //Repo/Foo/... -//Repo/Foo/Bar/Foobar.txt
文件排除似乎仅在您正在同步的文件/目录与您尝试排除的文件不匹配时才起作用。
I'm trying to use p4 sync to sync a specific directory to a given changelist number using wildcards but I also want to exclude a list of files that are under that directory (in subdirectories), I tried using - (both before and after using a path with wildcards) but the file never gets excluded, this the command I'm trying:
p4 sync //Repo/Foo/... -//Repo/Foo/Bar/Foobar.txt
The file exclusion seems to only work when the files/directories you are syncing don't match the files you're trying to exclude.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在您的客户端中,您将有多行:
这将允许您获取 Foo 目录中的所有内容以及除“子目录”之外的所有子目录。
In your client, you would have multiple lines:
This would allow you to get everything in the Foo directory and all subdirectories except "subdirectory".
如果您使用标签,则可以执行此操作。在您最喜欢的编辑器中创建一个标签(p4v 或命令行 p4 标签并添加两行:
如果您想要最新版本或更改列表,请在修订字段中输入
"#head"
(包括引号!)为标签命名 - 例如“sync_butnot_foobar”现在,您可以在命令行上同步:
这比修改客户端规范和同步头模型有巨大的好处,如果您排除客户端规范中的文件,则下一个文件将被删除。您同步该文件的时间将被带到修订版 0 这可能不是您想要的。
You can do this if you use a label. Create a label in your favorite editor (p4v or command line p4 label and add your two lines:
In the revision field put
"#head"
(including quotes!) if you want the latest or a change list number. Give the label a name - for instance "sync_butnot_foobar"On the command line you can now sync:
This has a huge benefit over the modify your client spec and sync head model. If you exclude a file in your client spec, the next time you sync that file will be brought to revision 0 which probably isn't what you wanted.
简而言之,您无法在同步时排除文件。这只能在客户端规范内完成。 (嗯,这可以通过保护表来完成,但我认为这确实是另一回事)。
但是,如果您想同步特定文件夹并且仅同步该文件夹中的文件,请使用 *
将仅同步 Foo 文件夹中的文件。
In short, you can't exclude files on a sync. That can only be done within the client spec. (Well, it could be done through the protections table, but that is really a different matter I think).
But if you want to sync a specific folder and only the files in that folder, use *
will get you only the files in the Foo folder.