Specify a list of files that contain lists of rules for ignoring files when adding client workspace files to the depot (p4 add) and when reconciling client workspaces (p4 reconcile).

Usage Notes

Each client machine can have its own rules, which apply to how the client interacts with the Helix Core Server.

Used by Client? Used by Server? Command-Line Alternative Can be set in P4CONFIG file?





To see the rules for your client machine, use the p4 ignores -v command.

To make P4IGNORE use exactly one file, set P4IGNORE to an absolute path.

Value if not Explicitly Set

Operating System Value



See also Default ignored paths in the p4 ignores topic.



where ; is the separator for Windows. On macOS, the separator would be :



Although P4IGNORE automatically includes the P4CONFIG and P4ROOT filenames, it does not automatically include the P4IGNORE filename. If you want to have a private P4IGNORE file that is not under source control, include your private P4IGNORE file in the P4IGNORE file list. Otherwise, p4 clean removes all the P4IGNORE files.

For examples of the types of files typically included in such a list of files, see Ignoring groups of files when adding in Helix Core Command-Line (P4) Guide.


You may use $home to set environment variables. For example


The syntax for the contents of a P4IGNORE file is not the same as Helix Server syntax. Instead, it is similar to that used by other versioning systems:

  • Rules are specified using local filepath syntax. Unix style paths will work on Windows for cross platform file support.
  • A # character at the beginning of a line denotes a comment.

    You can escape the # comment character with a backslash (\). This allows filenames beginning with # to be ignored.

  • A ! character at the beginning of a line line excludes the file specification. These exclusions override rules defined above it in the P4IGNORE file, but may be overridden by later rules.
  • A / (or \ on Windows) character at the beginning of a line causes the file specification to be considered relative to the P4IGNORE file. This is useful when the rule must apply to files at particular depots of the directory tree.
  • A / (or \ on Windows) character at the end of a line causes the file specification to only match directories, and not files of the same name.
  • The * wildcard matches substrings. Like the Helix Server wildcard equivalent, it does not match path separators. However, if the * wildcard is not used as part of a path, the directory scanning nature of the rule may make it appear to perform like the Perforce "..." wildcard.
  • The ** wildcard matches substrings including path separators. It is equivalent to the Helix Server "..." wildcard, which is not permitted.

For example:

# Ignore .p4ignore files

# Ignore object files, shared libraries, executables

# Ignore all HTML files except the readme file

# Ignore the bin directory

# Ignore the build.properties file in this directory

# Ignore all text files in test directories

The first match is used when figuring out what to ignore.

Use the p4 ignores command to get information about why a file is being ignored during add and reconcile operations. For example, the following command lets you know which line of the P4IGNORE file is being used to ignore a file.

$ p4 ignores -v -i mypath