Markus Michalski FAQ

git-sync-all: Repository inventory

The git-sync-all repos.yml inventory: format, groups, clone URLs, --verify with removal offer for unlisted repositories, and --issues for open GitHub issues.

Deutsche Version

Back to overview

git-sync-all: Repository inventory

The inventory is a YAML-style file repos.yml that lists which repositories should exist on a machine. --verify checks it against the disk, --issues queries open GitHub issues for the listed repositories.

Location

The tool picks the file in this order: --inventory FILE, then SYNC_INVENTORY_FILE, then ${XDG_CONFIG_HOME:-$HOME/.config}/git-sync-all/repos.yml. If the file is missing the tool stops with Inventory file not found.

git-sync-all --init-inventory

The command always creates the file at the XDG path. If the example file config/repos.yml.example is present (symlink installation) it is copied. Otherwise the tool generates a file with group all from the repositories it finds. It then opens the file in an editor if the terminal is interactive. An existing file is left untouched.

--init-inventory runs before the config file is loaded. The generated list therefore comes from the default directory $HOME/projekte (or from an SYNC_BASE_DIRS environment variable), not from SYNC_BASE_DIRS in the config file or from --config.

Format

all:
  - git-sync-all
  - dotfiles

work:
  - shopware6-sepa-67

external:
  - osticket: https://github.com/osTicket/osTicket

For every name the tool searches all SYNC_BASE_DIRS down to depth SYNC_SCAN_DEPTH for a directory of that name that contains .git.

Choosing groups

--group NAME filters to one group and can be repeated (--group work --group personal). A single value with a comma (--group work,personal) works as well. Without --group, SYNC_VERIFY_GROUP applies (default all). If the group does not exist the tool lists the available groups and exits with code 0.

--verify

git-sync-all --verify
git-sync-all --verify --group work

For every entry the tool prints [OK] name → path or [ERROR] name → NOT FOUND. Missing repositories are listed at the end with a clone hint:

The exit code is 1 if repositories are missing, otherwise 0.

Unlisted repositories

Afterwards --verify compares all repositories on disk with all groups of the inventory, regardless of the --group filter. For every unlisted repository the tool asks Remove <name> from disk? (<path>) [y/n/q] and runs rm -rf on the directory if you answer y.

The removal deletes the entire directory including local, unpushed commits and files. --yes is deliberately ignored here and every repository is asked individually. Without a terminal the repositories are only listed. With --dry-run they are listed and nothing is deleted.

--include and --exclude do not apply to --verify. The detection considers every repository with a .git directory under the base directories, including ones without a remote.

--issues

git-sync-all --issues
git-sync-all --issues --group work -v

This needs the GitHub CLI gh, logged in via gh auth login; otherwise the tool stops with an error. For every inventory entry it looks up the repository on disk and reads the GitHub owner and name from the remote URL (SYNC_REMOTE). The table shows the number of open issues per repository, -- when there are none, not found or not on GitHub. With -v the number and title are shown. The exit code is 1 if at least one repository has open issues.

At most 10 issues are requested per repository, so the displayed number never exceeds 10. Repositories whose name contains a dot (for example my-site.net) are not recognized by the URL parsing and show up as not on GitHub.