Helix Core is now P4. Product user interfaces will be updated soon. Learn more >>

P4 CLI Reference | 2025.1

# p4 ignores

Displays the ignore mappings computed from the rules in P4IGNORE files.

## Syntax

    p4 [g-opts] ignores [-v] [path ...]
    p4 [g-opts] ignores -i [-v] path ...

Syntax conventions

## Description

It’s not always easy to tell why a file is being ignored during add (p4 add) and reconcile (p4 reconcile) operations. To help with that, `p4 ignores` lets you see the mappings in Perforce syntax that are applied for any specified path.

If you do not specify a path, the mappings for the current working directory are displayed.

Using the `-v` option outputs the rule that generated mappings and the line number in the file where the rule is defined. See Examples.

The `-i` option checks whether a filepath would be ignored. If so, the path is returned. With the `-v` option, a more verbose message is returned explaining whether the filepath would be ignored and if it matched any ignore rules.

### Default ignored paths

The P4 and P4V clients by default ignore the following paths to allow better co-existence with the DVCS personal server functionality:

    .../.p4root/...
    .../.p4root

If the P4CONFIG variable is in use, the following path is also included:

    .../.p4config

## Options

`-i` | Test to see if the specified filepath would be ignored.
`-v` | Report additional information about the `P4IGNORE` rules in effect. When listing mappings, include the rules from which they were generated. When testing a filepath, include the rule that affected the output.
`path` | The path to be tested. Specify the path using local syntax.
`g-opts` | See Global options.

## Usage notes

Can File Arguments Use Revision Specifier? | Can File Arguments Use Revision Range? | Minimal Access Level Required
--- | --- | ---
No | No | `none`

## Examples

Note that in the following table, the commands in the left-hand column were run in the `c:\workspace` directory.

`p4 ignores` | Display a list of mappings generated from `P4IGNORE` rules.
    .../.p4root/...
    .../.p4root
    .../.p4config/...
    .../.p4config
    c:/workspace/.../builds/...
    c:/workspace/builds/...
    c:/workspace/.../builds
    c:/workspace/builds
`p4 ignores -v` | Display a list of mappings generated from `P4IGNORE` rules, including the rules that were generated from a `.p4ignore` file.
    #FILE - defaults
    #LINE 2:**/.p4root
    .../.p4root/...
    .../.p4root
    #LINE 1:**/.p4config
    .../.p4config/...
    .../.p4config
    #FILE c:\workspace\.p4ignore
    #LINE 1:builds
    c:/workspace/.../builds/...
    c:/workspace/builds/...
    c:/workspace/.../builds
    c:/workspace/builds
If the p4 client is on Windows, the name of the rules file might be `p4ignore.txt`, and the output could be similar to this:
    #FILE - defaults
    #LINE 1:**/.p4root
    .../.p4root/...
    .../.p4root
    #FILE c:\workspace\p4ignore.txt
    #LINE 2:*.html
    c:/workspace/....html/...
    c:/workspace/....html/
`p4 ignores -i file1 builds/file2` | Test to see whether `file1` and `file2` will be ignored. If a file is ignored, it will be returned. Otherwise, there will be no output.
    c:\workspace\builds\file2 ignored
`p4 ignores -i -v file1 builds/file2` | Test to see whether `file1` and `file2` will be ignored. If a file is ignored then it will be returned with information about the `P4IGNORE` rule that it matched. If it is not, it will be returned with a message saying that it is not ignored. If it matched a `P4IGNORE` exclusionary rule, information about that rule will also be returned.
    c:\workspace\file1 not ignored
    c:\workspace\builds\file2 ignored by
      c:\workspace\.p4ignore:1:builds

Your search for returned results