OS Manuals

/usr/bin/git-sync

A sidecar app which clones a git repo and keeps it in sync with the upstream.

From git-sync-fips 4.8.0-r0 (enterprise-packages), captured 2026-11-08 by running git-sync --help (exit 0). permalink

Usage: git-sync [FLAGS...]

 FLAGS:
      --add-user                                add a record to /etc/passwd for the current UID/GID (needed to use SSH with an arbitrary UID)
      --askpass-url string                      a URL to query for git credentials (username=<value> and password=<value>)
      --cookie-file                             use a git cookiefile (/etc/git-secret/cookie_file) for authentication
      --credential credentialSlice              one or more credentials (see --man for details) available for authentication (default [])
      --depth int                               create a shallow clone with history truncated to the specified number of commits (default 1)
      --error-file string                       the path (absolute or relative to --root) to an optional file into which errors will be written (defaults to disabled)
      --exechook-backoff duration               the time to wait before retrying a failed exechook (default 3s)
      --exechook-command string                 an optional command to be run when syncs complete (must be idempotent)
      --exechook-timeout duration               the timeout for the exechook (default 30s)
      --filter string                           use partial clone with the specified filter (e.g. 'blob:none', 'tree:0')
      --git string                              the git command to run (subject to PATH search, mostly for testing) (default "git")
      --git-config string                       additional git config options in 'section.var1:val1,"section.sub.var2":"val2"' format
      --git-config-add stringArray              add one additional git config option in 'section.var1:val1' format; can be repeated
      --git-gc string                           git garbage collection behavior: one of 'auto', 'always', 'aggressive', or 'off' (default "always")
      --github-app-application-id int           the GitHub app application ID to use for GitHub app auth
      --github-app-client-id string             the GitHub app client ID to use for GitHub app auth
      --github-app-installation-id int          the GitHub app installation ID to use for GitHub app auth
      --github-app-private-key-file string      the file from which the private key for GitHub app auth will be sourced
      --github-base-url string                  the GitHub base URL to use when making requests to GitHub when using GitHub app auth (default "https://api.github.com/")
      --group-write                             ensure that all data (repo, worktrees, etc.) is group writable
  -h, --help                                    print help text and exit
      --http-bind string                        the bind address (including port) for git-sync's HTTP endpoint
      --http-metrics                            enable metrics on git-sync's HTTP endpoint
      --http-pprof                              enable the pprof debug endpoints on git-sync's HTTP endpoint
      --init-max-failures int                   the number of consecutive failures allowed before aborting during the initial sync phase; a negative value retries forever; if unset, --max-failures applies instead
      --init-period duration                    how long to wait between sync attempts until the first success, must be >= 10ms if set; if unset, --period is used
      --link string                             the path (absolute or relative to --root) at which to create a symlink to the directory holding the checked-out files (defaults to the leaf dir of --repo)
      --man                                     print the full manual and exit
      --max-failures int                        the number of consecutive failures allowed before aborting (-1 will retry forever
      --one-time                                exit after the first sync
      --password-file string                    the file from which the password or personal access token for git auth will be sourced
      --period duration                         how long to wait between syncs, must be >= 10ms; --wait overrides this (default 10s)
      --pre-publish-exechook-backoff duration   the time to wait before retrying a failed pre-publish-exechook (default 3s)
      --pre-publish-exechook-command string     an optional command to be run before syncs complete (must be idempotent)
      --pre-publish-exechook-timeout duration   the timeout for the pre-publish-exechook (default 30s)
      --ref string                              the git revision (branch, tag, or hash) to sync (default "HEAD")
      --repo string                             the git repository to sync (required)
      --root string                             the root directory for git-sync operations (required)
      --sparse-checkout-file string             the path to a sparse-checkout file
      --ssh-key-file stringArray                the SSH key(s) to use (default [/etc/git-secret/ssh])
      --ssh-known-hosts                         enable SSH known_hosts verification (default true)
      --ssh-known-hosts-file string             the known_hosts file to use (default "/etc/git-secret/known_hosts")
      --stale-worktree-timeout duration         how long to retain non-current worktrees
      --submodules string                       git submodule behavior: one of 'recursive', 'shallow', or 'off' (default "recursive")
      --sync-on-signal string                   sync on receipt of the specified signal (e.g. SIGHUP)
      --sync-timeout duration                   the total time allowed for one complete sync, must be >= 10ms; --timeout overrides this (default 2m0s)
      --touch-file string                       the path (absolute or relative to --root) to an optional file which will be touched whenever a sync completes (defaults to disabled)
      --username string                         the username to use for git auth
  -v, --verbose int                             logs at this V level and lower will be printed
      --version                                 print the version and exit
      --webhook-backoff duration                the time to wait before retrying a failed webhook (default 3s)
      --webhook-method string                   the HTTP method for the webhook (default "POST")
      --webhook-success-status int              the HTTP status code indicating a successful webhook (0 disables success checks (default 200)
      --webhook-timeout duration                the timeout for the webhook (default 1s)
      --webhook-url string                      a URL for optional webhook notifications when syncs complete (must be idempotent)

 ENVIRONMENT VARIABLES:
  GITSYNC_GITHUB_APP_PRIVATE_KEY string         the private key to use for GitHub app auth
                GITSYNC_PASSWORD string         the password or personal access token to use for git auth
Options (55)
OptionDescriptionSource
--add-useradd a record to /etc/passwd for the current UID/GID (needed to use SSH with an arbitrary UID)help
--askpass-url stringa URL to query for git credentials (username=<value> and password=<value>)help
--cookie-fileuse a git cookiefile (/etc/git-secret/cookie_file) for authenticationhelp
--credential credentialSliceone or more credentials (see --man for details) available for authentication (default [])help
--depth intcreate a shallow clone with history truncated to the specified number of commits (default 1)help
--error-file stringthe path (absolute or relative to --root) to an optional file into which errors will be written (defaults to disabled)help
--exechook-backoff durationthe time to wait before retrying a failed exechook (default 3s)help
--exechook-command stringan optional command to be run when syncs complete (must be idempotent)help
--exechook-timeout durationthe timeout for the exechook (default 30s)help
--filter stringuse partial clone with the specified filter (e.g. 'blob:none', 'tree:0')help
--git stringthe git command to run (subject to PATH search, mostly for testing) (default "git")help
--git-config stringadditional git config options in 'section.var1:val1,"section.sub.var2":"val2"' formathelp
--git-config-add stringArrayadd one additional git config option in 'section.var1:val1' format;help
--git-gc stringgit garbage collection behavior: one of 'auto', 'always', 'aggressive', or 'off' (default "always")help
--github-app-application-id intthe GitHub app application ID to use for GitHub app authhelp
--github-app-client-id stringthe GitHub app client ID to use for GitHub app authhelp
--github-app-installation-id intthe GitHub app installation ID to use for GitHub app authhelp
--github-app-private-key-file stringthe file from which the private key for GitHub app auth will be sourcedhelp
--github-base-url stringthe GitHub base URL to use when making requests to GitHub when using GitHub app auth (default "https://api.github.com/")help
--group-writeensure that all data (repo, worktrees, etc.) is group writablehelp
-h, --helpprint help text and exithelp
--http-bind stringthe bind address (including port) for git-sync's HTTP endpointhelp
--http-metricsenable metrics on git-sync's HTTP endpointhelp
--http-pprofenable the pprof debug endpoints on git-sync's HTTP endpointhelp
--init-max-failures intthe number of consecutive failures allowed before aborting during the initial sync phase;help
--init-period durationhow long to wait between sync attempts until the first success, must be >= 10ms if set;help
--link stringthe path (absolute or relative to --root) at which to create a symlink to the directory holding the checked-out files (defaults to the leaf dir of --repo)help
--manprint the full manual and exithelp
--max-failures intthe number of consecutive failures allowed before aborting (-1 will retry foreverhelp
--one-timeexit after the first synchelp
--password-file stringthe file from which the password or personal access token for git auth will be sourcedhelp
--period durationhow long to wait between syncs, must be >= 10ms;help
--pre-publish-exechook-backoff durationthe time to wait before retrying a failed pre-publish-exechook (default 3s)help
--pre-publish-exechook-command stringan optional command to be run before syncs complete (must be idempotent)help
--pre-publish-exechook-timeout durationthe timeout for the pre-publish-exechook (default 30s)help
--ref stringthe git revision (branch, tag, or hash) to sync (default "HEAD")help
--repo stringthe git repository to sync (required)help
--root stringthe root directory for git-sync operations (required)help
--sparse-checkout-file stringthe path to a sparse-checkout filehelp
--ssh-key-file stringArraythe SSH key(s) to use (default [/etc/git-secret/ssh])help
--ssh-known-hostsenable SSH known_hosts verification (default true)help
--ssh-known-hosts-file stringthe known_hosts file to use (default "/etc/git-secret/known_hosts")help
--stale-worktree-timeout durationhow long to retain non-current worktreeshelp
--submodules stringgit submodule behavior: one of 'recursive', 'shallow', or 'off' (default "recursive")help
--sync-on-signal stringsync on receipt of the specified signal (e.g. SIGHUP)help
--sync-timeout durationthe total time allowed for one complete sync, must be >= 10ms;help
--touch-file stringthe path (absolute or relative to --root) to an optional file which will be touched whenever a sync completes (defaults to disabled)help
--username stringthe username to use for git authhelp
-v, --verbose intlogs at this V level and lower will be printedhelp
--versionprint the version and exithelp
--webhook-backoff durationthe time to wait before retrying a failed webhook (default 3s)help
--webhook-method stringthe HTTP method for the webhook (default "POST")help
--webhook-success-status intthe HTTP status code indicating a successful webhook (0 disables success checks (default 200)help
--webhook-timeout durationthe timeout for the webhook (default 1s)help
--webhook-url stringa URL for optional webhook notifications when syncs complete (must be idempotent)help

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.