你能“忽略"吗? Perforce中的文件? [英] Can you "ignore" a file in Perforce?

查看:267
本文介绍了你能“忽略"吗? Perforce中的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时我会使用Perforce的P4V IDE中的协调离线工作..."功能来同步与P4软件仓库断开连接时正在处理的所有文件.它会启动另一个执行文件夹差异"的窗口.

I sometimes use the feature 'Reconcile Offline Work...' found in Perforce's P4V IDE to sync up any files that I have been working on while disconnected from the P4 depot. It launches another window that performs a 'Folder Diff'.

我有一些我永远不想检入源代码管理的文件(例如在bin文件夹中找到的文件,例如DLL,代码生成的输出等).是否有一种方法可以过滤掉那些文件/文件夹,使其不显得新"可能会添加.它们往往使我真正感兴趣的文件列表变得混乱.P4是否具有Subversion的忽略文件"功能的等效功能?

I have files I never want to check in to source control (like ones found in bin folder such as DLLs, code generated output, etc.) Is there a way to filter those files/folders out from appearing as "new" that might be added. They tend to clutter up the list of files that I am actually interested in. Does P4 have the equivalent of Subversion's 'ignore file' feature?

推荐答案

从2012.1版本开始,Perforce支持P4IGNORE环境变量.我更新了对有关忽略目录的问题的答案,并解释了其工作原理.然后我注意到了这个答案,我想这是多余的.

As of version 2012.1, Perforce supports the P4IGNORE environment variable. I updated my answer to this question about ignoring directories with an explanation of how it works. Then I noticed this answer, which is now superfluous I guess.

假设您有一个名为"CLIENT"的客户端,一个名为"foo"的目录(位于项目根目录),并且希望忽略该目录树中的所有.dll文件,则可以将以下行添加到工作区中查看以实现此目的:

Assuming you have a client named "CLIENT", a directory named "foo" (located at your project root), and you wish to ignore all .dll files in that directory tree, you can add the following lines to your workspace view to accomplish this:


-//depot/foo/*.dll //CLIENT/foo/*.dll
-//depot/foo/.../*.dll //CLIENT/foo/.../*.dll

第一行将其从目录"foo"中删除,第二行将其从所有子目录中删除.现在,当您协调脱机工作..."时,所有.dll文件都将移动到文件夹diff显示底部的已排除文件"文件夹中.它们将不碍您使用,但如果您确实需要,仍可以查看和操作它们.

The first line removes them from the directory "foo" and the second line removes them from all sub directories. Now, when you 'Reconcile Offline Work...', all the .dll files will be moved into "Excluded Files" folders at the bottom of the folder diff display. They will be out of your way, but can still view and manipulate them if you really need to.

您还可以使用另一种方式,将"Excluded Files"文件夹减少到一个,但是由于路径已损坏,您将无法操作其中包含的任何文件(但是如果您只是希望他们不碍事,没关系).

You can also do it another way, which will reduce your "Excluded Files" folder to just one, but you won't be able to manipulate any of the files it contains because the path will be corrupt (but if you just want them out of your way, it doesn't matter).


-//depot/foo.../*.dll //CLIENT/foo.../*.dll

这篇关于你能“忽略"吗? Perforce中的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆