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

P4 CLI Documentation | 2025.2

# p4 filelog

Print detailed information about the revisions of files.

## Syntax

    p4 [g-opts] filelog [-c change] [-h -i -l -L -t -p -s] [-m max] FileSpec[revSpec]

Syntax and naming conventions

## Description

p4 filelog describes each revision of the files provided as arguments. At least one file or file pattern must be provided as an argument. If the file specification includes a revision range, only the specified revisions are listed.

By default, the output consists of one line per revision in reverse chronological order. The format of each line is:

    ... #rev change chnum action on date by user@client (type) 'description'

where:

- rev is the revision number
- chnum is the number of the submitting changelist

- action is the operation the file was open for. See the Description of `p4 integrated`.

- date is the submission date (by default), or date and time if the `-t` option is used
- user is the name of the user who submitted the revision
- client is the name of the client workspace from which the revision was submitted
- type is the type of the file at the given revision

- description is the first 30 characters of the corresponding changelist’s description

  If the `-l` option is used, the `description` is the full changelist description as entered when the changelist was submitted. If the `-L` option is used, the description is the full changelist description, truncated to 250 characters.

By default, this command is optimized not to display history of a file which is deleted in the most recent commit, or has been removed previously.

To view the full history of a deleted file, specify the `-d` flag.

This option cannot be used with paths containing wildcards.

The `-m max` option displays at most `max` commits.

The `--first-parent` option follows only the first parent of each commit.

## Options

Option | Description
--- | ---
`-c change` | Display only files submitted at the specified changelist number.
`-h` | Display file content history instead of file name history. The revisions that are listed include revisions of other files that were branched/copied (using `p4 integrate` and `p4 resolve` -at) to the specified revision. Revisions that were replaced by copying or branching are not displayed, even if they are in the history of the specified revision.
`-i` | Follow file history across branches. If a file was created by integration (`p4 integrate`), P4 Server describes the file’s revisions and displays the revisions of the file from which it was branched (back to the branch point of the original file). File history inherited by renaming (`p4 move`) is always displayed, regardless of whether or not the `-i` option is used.
`-l` | List long output, with the full text of each changelist description.
`-L` | List long output, with the full text of each changelist description truncated at 250 characters.
`-m max` | List only the first `max` changes per file output.
`-p` | When used with the `-h` option, do not follow content of promoted task streams. This option is useful when there are many child task streams branched from the supplied `file` argument.
`-s` | Display a shortened form of output by ignoring non-contributory integrations (for example, integrations involving "branch into" or copy into" operations are not displayed)
`-t` | Display the time as well as the date.
`g-opts` | See Global options.

## Usage notes

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

- The output of `p4 filelog` can be large when called with non-restrictive file arguments. For example, `p4 filelog //depot/...` displays the revision history for every file in the depot. However, `p4 filelog` commands can be subject to a `maxresults` limitation that is set in `p4 group`.
- If both the `-i` and the `-m maxrev` options are used, and a branch is encountered within the most recent `maxrev` revisions of the file, the most recent `maxrev` revisions of the file prior to the branch point are also displayed. `p4 filelog -i` follows branches down to a depth of 50 levels, which should be more than sufficient for any site.
- Old revisions of temporary object files (file type modifier `+S`n``) are displayed with an action of `purge`.

## Examples

`p4 filelog //depot/proj1/...` | Display the revision history for every file under the depot’s `proj1` directory.
`p4 filelog file1.c@100,@120` | Display the revision history for `file1.c` from changelists 100 through 120.
`p4 filelog file1.c#have,#head` | If you do not have the latest revision of `file1.c`, display revision history since your last sync.
`p4 filelog file1.c file1.h` | Show the revision history for files `file1.c` and `file1.h`, which reside locally in the current working directory.

## Related commands

To read additional information about each file | `p4 files`
To display file information in a format suitable for scripts | `p4 fstat`
To view a list of open files | `p4 opened`
To view a list of files you’ve synced to your client workspace | `p4 have`

Your search for returned results