Ignoring groups of files when adding
Sometimes development processes result in the creation of extraneous content that should not be submitted to the depot. Possible examples:
- compilers produce object files and executables during development
- text editors and word processors produce backup files
- some individuals might have informal notes on work in progress
To ignore files (or groups of files) when adding to the depot:
- Create a file with a list of file specifications to ignore.
- Set the
P4IGNORE
environment variable to point to this file.
When you add files, the full local path and parent directories of any
file to be added are searched for P4IGNORE
files. If any
P4IGNORE
files exist, their rules are added to a list, with
greater precedence given to P4IGNORE
rules closest to the
file being added. For details on syntax and an example, see P4IGNORE in the Helix Core Command-Line (P4) Reference.
To override the P4IGNORE
file, use the
-I
option with the p4 add
, p4
reconcile
, or p4 status
commands.
Reporting ignored files
The p4 ignores
command reports the ignore mappings
in effect. Specifically, it displays the ignore mappings from
the rules in the P4IGNORE
file. If you add the -i
option, it reports whether a particular
file (or set of files) will be ignored.