Plugin catalog

git_status

Adds Git status to each entry in default listings, plus branch and last commit in long listings.

↓ on this page

git_status adds each entry's Git status to a listing, plus the branch and last commit in the long view. Turn it on when you want Git state next to your files in every listing. For a dedicated commit view, use lla --git from the Git view.

Turn it on

# ~/.config/lla/config.toml
enabled_plugins = ["git_status"]

Or run this once. It saves the same setting, so the plugin stays on until you run lla --disable-plugin git_status.

lla --enable-plugin git_status

Output appears in the default and long views (formats = ["default", "long"]), and in the table view, which uses the long format. A directory's status sums the entries under it.

FieldTypeHolds
git_statusstringclean, modified, untracked and so on
git_branchstringCurrent branch
git_stagedintegerStaged entries
git_modifiedintegerModified entries

JSON also carries untyped strings: git_commit, git_untracked and git_conflicts.

lla --json | jq '.[] | select(.name=="src") | .plugin'
{
  "git_modified": 1,
  "git_commit": "420df49 Tweak engine",
  "git_branch": "main",
  "git_untracked": "0",
  "git_staged": 0,
  "git_status": "modified",
  "git_conflicts": "0"
}

You can also add them as columns. The plugin's block still prints with each row.

[formatters.table]
columns = ["name", "field:git_status", "field:git_branch"]

Actions

Run an action with lla plugin run git_status help. help prints usage and is interactive, so it needs a TTY and the default --output human. Running it also enables the plugin and saves that setting.

Example

lla
README.md 
┌─
│ Git          clean
└─
 
docs/ 
┌─
│ Git          untracked
└─
 
src/ 
┌─
│ Git          modified
└─
lla -l --hide-group
drwxr-xr-x  96B Nov 04 22:53 you src/ 
┌─
│ Branch       main
│ Commit       3f8c938 Update main 3
│ Status       1 modified
└─

Settings

~/.config/lla/plugins/git_status/config.toml sets colors in a [colors] table: info, branch, commit, clean and modified.

Permissions

process = true, because it runs git rev-parse, git log and git status. filesystem = ["metadata:tree"].