docs / reference / flags-output
v0.14.2 linux · mac · windows
updated 0001-01-01 v0.14.2

Flags & Output

Global flags, per-command flags, output modes, and dry-run behaviour

Global flags

These flags are available on every command and can be written before or after the command name: gip --json status and gip status --json are the same. After the command they are recognized up to the first argument that is not a flag, or --: in gip exec -- git log -q the -q belongs to git log.

FlagDescription
-f, --file <path>Path to the configuration file (overrides all other lookup methods)
-d, --debugVerbose output: logs every git command executed, the config file path and informational notices (e.g. repositories whose provider cannot be detected)
-q, --quietSuppress per-project output and the progress bar; tables, warnings (on stderr) and the summary line are still printed
--jsonEmit a single JSON envelope to stdout instead of text output; takes precedence over --quiet
--noopDry-run: print what would be done without executing any git command
-m, --ignore-missingDo not print the warning for projects whose local_path does not exist or is not a git repository (they are skipped either way)
--strictA missing local_path (or a missing extra branch) is an error instead of a skipped project: the command exits with status 1. Meant for CI, e.g. gip --strict pull
-v, --versionPrint version, revision and build date
-h, --helpShow help; gip <command> --help shows the command’s flags

Command flags

Parallel command flags

The following flags are available on all parallel commands (status, statusfull, pull, fetch, branch, releases, exec):

FlagDescription
-j, --jobs <n>Maximum number of repositories to process concurrently, 1–32 (default: 4)
-t, --timeout <seconds>Per-operation timeout in seconds; 0 means no timeout (default: 0)
--tag <tags>Filter projects by tag — comma-separated and/or repeated, OR logic (e.g. --tag work,js or --tag work --tag js)
--errors-lastAlso print a grouped error section after the summary (errors are still shown inline)
--show-skippedAlso print the skipped projects, each with the reason it was skipped, after the summary
--dirtyOnly include repos with uncommitted changes (staged, unstaged or untracked files; a stash alone does not count)
--behindOnly include repos behind their upstream (diverged included); requires up-to-date remote refs — run gip fetch first
--aheadOnly include repos ahead of their upstream (diverged included); requires up-to-date remote refs — run gip fetch first
--unsyncedOnly include repos out of sync with upstream (ahead or behind); alias for --behind --ahead

list accepts --tag, -j, -t and the git-state filters, but not --errors-last or --show-skipped (see list). pull adds -a/--all and --force (see pull).

Releases flags

Available on releases, in addition to the parallel command flags.

FlagDescription
-p, --pendingOnly include projects with commits after the latest tag, or never tagged
--taggedOnly include projects with at least one tag (hides (none) and (no commits))
--min <n>Only include projects with at least n commits after the latest tag; never-tagged projects count all their commits unless --tagged is given (default 0: no minimum)
--match <glob>Only consider tags matching the glob (git describe --match), e.g. 'v*'

Extended view (--extended)

Available on branch and list. On branch it runs additional git calls per repo to collect upstream sync state, working-tree indicators and last commit info; list always shows branch and sync status, and --extended only adds the DIRTY column.

FlagAvailable onDescription
--extendedbranchAdd STATUS, DIRTY, COMMIT and DATE columns
--extendedlistAdd the DIRTY column

STATUS values and colours (TTY only):

ValueMeaningColour
syncedUp to date with upstreamGreen
↑NN commits ahead of upstreamMagenta
↓NN commits behind upstreamYellow
↑N↓MDiverged — N ahead, M behindRed
local-onlyBranch never pushed: no upstream and no remote branch with the same nameWhite
no-upstreamBranch on the remote under the same name, but not tracked (git branch -u)White
upstream-goneUpstream configured but deleted on the remoteWhite
detachedDetached HEAD: no branch to trackWhite

list shows synced* for a repo in sync with its upstream but with uncommitted changes.

DIRTY symbols:

SymbolMeaning
+Staged changes
*Unstaged changes
?Untracked files
$Stash present
—Clean working tree

Git-state filter flags (--dirty / --behind / --ahead / --unsynced)

These flags skip repos that do not match the requested state before running the main operation. An extra git status --porcelain=v2 --branch call (plus git stash list) is made per repo to evaluate the condition. When several are given, --dirty must match and at least one of the sync filters must match. --unsynced is shorthand for --behind --ahead and matches any repo that is ahead of or behind its upstream. A repo without upstream never matches the sync filters. If the state of a repo cannot be read, it is reported as an error instead of being treated as matching.

# show status only for repos with uncommitted changes
gip status --dirty

# pull only repos that are behind their upstream
gip pull --behind

# list repos that have drifted from upstream in either direction
gip list --unsynced --extended

# run stash only in repos with local changes
gip exec --dirty -- git stash

# see which repos need attention
gip branch --dirty --extended
gip branch --behind --extended

Note: --behind, --ahead and --unsynced compare against the last fetched remote tracking refs. If you have not run gip fetch recently the result may be stale.

Output modes

Text (default)

Each project prints its git output inline as it completes. A progress bar is shown on stderr while processing (TTY only, suppressed in --quiet and --json modes). branch and releases print their table after all projects are processed. At the end a summary line is printed (not by list):

─────────────────────────────────────────
OK: 5   Errors: 1   Skipped: 3 (missing 1, filtered 2)   Duration: 3.4s

The skipped projects are split by kind (only the non-zero kinds are shown): missing (the configured directory or branch does not exist: usually a configuration to fix), protected (gip refused to touch the repository: pull_policy: never, uncommitted changes without --force) and filtered (excluded by a filter or nothing to do). Skipped always means “not looked at or not touched”: a repository that was examined and found clean counts as OK.

The projects that need a decision are named under the summary, with their reason, without any flag (at most five per kind, then +N more):

OK: 4   Errors: 0   Skipped: 3 (missing 2, protected 1)   Duration: 1.2s
  missing: api (directory does not exist), legacy (not a git repository)
  protected: web (uncommitted changes, use --force)

filtered projects are not named; --show-skipped lists every skipped project with its reason. --quiet prints the summary line only.

Quiet (--quiet)

Per-project output and the progress bar are suppressed, as is the gip: using configuration line (printed only for a .gip found in the current directory). Tables (list, branch, releases), the final summary line and warnings and errors (on stderr) are still printed.

JSON (--json)

A single JSON envelope is written to stdout after all projects have been processed; warnings and the gip: using configuration line go to stderr, so stdout can be piped to jq. The shape below is shared by status, statusfull, pull, fetch, branch, releases and exec; list uses its own shape without summary (see list) and so does check (see check). Extra branches appear as separate entries named name@branch.

Every envelope starts with schema_version (currently 2): it changes only when a field is removed or changes meaning, while new fields can be added without changing it. Projects are sorted by name, so two runs on the same repositories give the same order. command is the command that ran (statusfull, not status, for gip statusfull).

{
  "schema_version": 2,
  "command": "statusfull",
  "timestamp": "2025-05-15T10:30:00Z",
  "projects": [
    {
      "name": "broken",
      "local_path": "/home/user/broken",
      "status": "error",
      "error": "exit status 128: fatal: not a git repository"
    },
    {
      "name": "frontend",
      "local_path": "/home/user/projects/frontend",
      "status": "ok",
      "state": {
        "upstream": true, "ahead": 0, "behind": 0,
        "dirty": true, "staged": false, "unstaged": true, "untracked": true, "stashed": false
      },
      "files": [
        { "path": "src/app.ts", "index": ".", "worktree": "M" },
        { "path": "notes.md", "index": "?", "worktree": "?" }
      ]
    },
    {
      "name": "legacy",
      "local_path": "/home/user/projects/legacy",
      "status": "skipped",
      "reason": "directory does not exist",
      "skip": "missing"
    }
  ],
  "summary": {
    "total": 3,
    "ok": 1,
    "errors": 1,
    "skipped": 1,
    "skipped_by": { "missing": 1, "protected": 0, "filtered": 0 },
    "duration_ms": 1240
  },
  "warnings": []
}

status values: ok, error, skipped. error holds the error message of failed entries; skipped entries have a reason and a skip kind (missing, protected, filtered, see Text), counted in summary.skipped_by (all three keys always present):

ReasonKindWhen
directory does not existmissinglocal_path does not exist (gip pull --all clones it)
not a git repositorymissinglocal_path exists but has no .git
branch not found locallymissingan extra branches entry that does not exist
pull_policy: neverprotectedpull / fetch on a project with pull_policy: never
uncommitted changes, use --forceprotectedpull on a dirty repo
not dirty, not ahead or behind, not behind, not aheadfilteredexcluded by a git-state filter
no commits, no tags, no commits after latest tag, fewer than <n> commits after latest tagfilteredexcluded by releases --tagged / --pending / --min
in sync, no upstream configured, ahead of upstream (nothing to pull)filteredextra branches entries

With --strict the missing entries become errors ("status": "error", "error": "directory does not exist (--strict)").

Command results

Each entry carries the data of the command that ran, so a script or an agent never has to run git again to read it. A field is omitted when the data was not read (skipped or failed project, --noop); once present, it is complete: false, 0 and empty values are written.

FieldCommandsDescription
filesstatus, statusfullChanged files of git status --porcelain (untracked ones only with statusfull): path, orig_path (source of a rename or copy), index and worktree (the X and Y status letters, . when unchanged, ? for untracked files). [] for a clean tree
execexecexit_code (-1 when the command did not start or was stopped by --timeout), stdout and stderr of the command, also when it failed
pullpullcloned (true for a repository cloned by --all or pull_policy: always), updated, from and to (HEAD before and after, full hashes; from is omitted for a clone), commits (number of commits between them)
branchbranch, releases, extra branchesCurrent branch name or "(detached)"
statestatusfull, branch --extended, git-state filtersUpstream delta and working tree, described below
commit_msg, commit_datebranch --extendedLast commit subject and relative date (e.g. "2 hours ago")

The state object

FieldTypeDescription
upstreamboolAn upstream tracking branch is configured
ahead, behindintCommits ahead of and behind the upstream
dirtyboolUncommitted changes: staged, unstaged or untracked (a stash alone does not count)
staged, unstaged, untracked, stashedboolEach kind of change; stashed is true when the stash is not empty
{
  "schema_version": 2,
  "command": "branch",
  "timestamp": "2025-05-15T10:30:00Z",
  "projects": [
    {
      "name": "backend",
      "local_path": "/home/user/projects/backend",
      "status": "ok",
      "branch": "dev",
      "state": {
        "upstream": true, "ahead": 2, "behind": 0,
        "dirty": true, "staged": true, "unstaged": true, "untracked": false, "stashed": false
      },
      "commit_msg": "feat: add auth endpoint",
      "commit_date": "2 hours ago"
    }
  ],
  "summary": { "total": 1, "ok": 1, "errors": 0, "skipped": 0, "skipped_by": { "missing": 0, "protected": 0, "filtered": 0 }, "duration_ms": 45 },
  "warnings": []
}

Changes from schema version 1

Version 1 envelopes had no schema_version. Version 2 replaces the top-level ahead, behind (omitted when 0), no_remote and dirty (a string of symbols such as "+*?") with the state object, sorts the projects by name, reports statusfull as its own command and adds files, exec and pull.

Tag JSON fields (releases)

The releases command adds to each project entry with at least one commit:

FieldTypeDescription
branchstringChecked-out branch the tag is looked up from
last_tagstringLatest tag reachable from HEAD; omitted when the project was never tagged
commits_since_tagintCommits after last_tag (total commits when never tagged); always present, 0 included
tag_datestringRelative creation date of the tag (e.g. "3 weeks ago")
unreleasedbooltrue when there are commits after the tag, or the project was never tagged; omitted when false

Git fields in list JSON

list entries include branch and the state object whenever the repository could be read, with or without --extended (same meaning as above; no commit fields).

No ANSI codes appear in any JSON output.

Dry-run (--noop)

No git command (or exec command) is executed. Each project prints a [DRY-RUN] line describing what would happen, and the summary is followed by a reminder. Projects that would run count as OK. The exit status is 0 unless a local_path cannot be resolved (e.g. unset environment variable). Git-state filters are not evaluated in dry-run mode. --noop has no effect on list, init and completion; check prints a [DRY-RUN] line per project and checks nothing.

$ gip --noop pull
[DRY-RUN] frontend → git pull  (in /home/user/projects/frontend)
[DRY-RUN] legacy → SKIPPED  (pull_policy: never)
─────────────────────────────────────────
OK: 1   Errors: 0   Skipped: 1 (protected 1)   Duration: 0.0s
DRY-RUN — no operations performed. Remove --noop to proceed.

Exit status

StatusMeaning
0Every project succeeded or was skipped
1At least one project failed, or is missing with --strict; also when gip cannot run at all (git not installed, init cannot write its file)
2Usage or configuration error, nothing was done: configuration not found, unreadable or invalid (bad YAML, duplicate names), unknown command or flag, bad flag value (--jobs 0, --min -1), missing argument (gip exec without a command)

So a script can tell “some repositories need attention” from “gip was called or configured wrongly”:

gip --strict --json pull > result.json
case $? in
  0) echo "all good" ;;
  1) jq -r '.projects[] | select(.status == "error") | .name' result.json ;;
  2) echo "fix the gip invocation or configuration" >&2; exit 2 ;;
esac

Errors and warnings

Every message says what went wrong and, where gip can tell, what to do next.

A failed git command is shown once, under the project’s path, with its exit status and git’s own diagnostic:

/home/user/projects/api
git pull failed (exit status 128)
fatal: could not read Username for 'https://github.com': terminal prompts disabled

At the end the failed projects are listed on stderr, one line each: the most telling line of the git output (fatal: ...), followed by a hint for well-known causes:

- api: exit status 128: fatal: could not read Username for 'https://github.com': terminal prompts disabled (hint: authentication required: configure a git credential helper or use an SSH URL)

Hints cover missing credentials, rejected SSH keys and unknown host keys, unresolved or unreachable hosts, untrusted TLS certificates, repositories not found, a non-empty or non-git local_path, a stale index.lock, branches without upstream or upstream deleted on the remote, detached HEAD, local changes in the way of a pull, diverged branches and, for exec, commands not found. With --errors-last the list appears only in the summary’s error section.

A project that is skipped because of its local_path gets a warning naming the project and the way out (-m hides it):

api: /home/user/projects/api does not exist (clone it with 'gip pull --all'; -m hides this warning)
legacy: /home/user/legacy is not a git repository (fix local_path; -m hides this warning)

Usage errors stop the command before it touches any repository (exit status 2):

  • an unknown command suggests the closest one (Did you mean "status"?);
  • status, statusfull, list, pull, fetch, branch, releases and check take no arguments: an argument such as gip status frontend is refused instead of being ignored (the command would otherwise run on every project), and the message points to --tag;
  • a configuration file that cannot be found suggests gip init or -f; an invalid one is reported once, with the file name and the YAML error.

When git is not installed or not in PATH, gip says so (git executable not found in PATH: install git or add its directory to PATH) and exits with status 1.

Colors

Colors are used only when the output stream is a terminal. They are disabled by NO_COLOR (any non-empty value, see no-color.org) and by TERM=dumb, and forced with FORCE_COLOR (any non-empty value other than 0), e.g. in CI systems that render ANSI in their logs. NO_COLOR wins over FORCE_COLOR. Piped or redirected output never contains escape sequences unless FORCE_COLOR is set.

Commands →