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

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

问题描述

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

我有一些文件我从来不想签入源代码管理(例如在 bin 文件夹中找到的文件,例如 DLL、代码生成的输出等)有没有办法过滤掉这些文件/文件夹,使其不显示为新"可能会添加.他们往往会把我真正感兴趣的文件列表弄得乱七八糟.P4 是否具有等同于 Subversion 的忽略文件"功能?

解决方案

从 2012.1 版开始,Perforce 支持 P4IGNORE 环境变量.我更新了我对这个关于忽略目录的问题的回答,并解释了它是如何工作的.然后我注意到这个答案,我猜现在是多余的.

<小时>

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

<前>-//depot/foo/*.dll//CLIENT/foo/*.dll-//depot/foo/.../*.dll//CLIENT/foo/.../*.dll

第一行将它们从目录foo"中删除,第二行将它们从所有子目录中删除.现在,当您协调离线工作..."时,所有 .dll 文件都将移动到文件夹差异显示底部的排除文件"文件夹中.它们将挡在您的视线之外,但如果您确实需要,仍然可以查看和操作它们.

你也可以用另一种方式来做,这会将你的排除的文件"文件夹减少到一个,但你将无法操作它包含的任何文件,因为路径会损坏(但如果你只是想让他们走开,没关系).

<前>-//depot/foo.../*.dll//CLIENT/foo.../*.dll

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'.

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?

解决方案

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.


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

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.

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天全站免登陆