GIT-LAST-MODIFIED(1) Git Manual GIT-LAST-MODIFIED(1)

# [NAME](#NAME)

git-last-modified - EXPERIMENTAL: Show when files were last modified

# [SYNOPSIS](#SYNOPSIS)

```
git last-modified [--recursive] [--show-trees] [--max-depth=<depth>] [-z]


                  [<revision-range>] [[--] <pathspec>...]
```

# [DESCRIPTION](#DESCRIPTION)

Shows which commit last modified each of the relevant files and subdirectories. A commit renaming a path, or changing it’s mode is also taken into account.

THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE.

# [OPTIONS](#OPTIONS)

**-r**, **--recursive**

Recursively traverse into all subtrees. By default, the command only shows tree entries matching the *&lt;pathspec&gt;*. With this option, it descends into subtrees and displays all entries within them. Equivalent to **--max-depth=-1**.

**-t**, **--show-trees**

Show tree entries even when recursing into them.

**--max-depth=&lt;depth&gt;**

For each pathspec given on the command line, traverse at most *&lt;depth&gt;* levels into subtrees. A negative value means no limit. The default is 0, which shows all paths matching the pathspec without descending into subtrees.

**-z**

Terminate each line with a *NUL* character rather than a newline.

*&lt;revision-range&gt;*

Only traverse commits in the specified revision range. When no *&lt;revision-range&gt;* is specified, it defaults to **HEAD** (i.e. the whole history leading to the current commit). For a complete list of ways to spell *&lt;revision-range&gt;*, see the *Specifying Ranges* section of [**gitrevisions**(7)](/man/os/git/gitrevisions.7).

\[**--**] *&lt;pathspec&gt;*...

Show the commit that last modified each path matching *&lt;pathspec&gt;*. If no *&lt;pathspec&gt;* is given, all files and subdirectories are included. See [**gitglossary**(7)](/man/os/git/gitglossary.7) for details on pathspec syntax.

# [OUTPUT](#OUTPUT)

The output is in the format:

```


 <oid> TAB <path> LF
```

If a path contains any special characters, the path is C-style quoted. To avoid quoting, pass option **-z** to terminate each line with a NUL.

```


 <oid> TAB <path> NUL
```

# [SEE ALSO](#SEE_ALSO)

[**git-blame**(1)](/man/os/git/git-blame.1), [**git-log**(1)](/man/os/git/git-log.1).

# [GIT](#GIT)

Part of the [**git**(1)](/man/os/git/git.1) suite

2026-09-28 Git 2.56.0.1.gaef21129

---

Document: git-last-modified(1) from git 2.56.0-r2 (Chainguard OS)
Source: https://kernel.googlesource.com/pub/scm/git/git.git
