Get status information about multiple Git repositories
Find a file
2023-10-14 13:36:46 +02:00
flake.lock add flake 2023-09-16 13:53:34 +02:00
flake.nix add completion 2023-09-27 12:23:46 +02:00
gis trap background processes 2023-10-14 12:43:37 +02:00
gis_completion.bash add completion 2023-09-27 12:23:46 +02:00
install.bash add completion 2023-09-27 12:23:46 +02:00
install.zsh add completion 2023-09-27 12:23:46 +02:00
README.org structure installation 2023-10-14 13:36:46 +02:00
screenshot.png update README 2023-09-17 00:18:58 +02:00

gis

gis is a Bash script which shows a status summary of multiple Git repositories.

It was inspired by wstool, vcstool and the default Starship prompt.

/denis/gis/media/commit/ed35a268d8ff3d1de4a1f722de54b3482644482c/screenshot.png

Usage

  Usage: gis [COMMANDS] [OPTIONS]

  Show a status summary of all Git repositories which are found recursively in
  current work directory. If the colon-separated environment variable $GIS_PATH
  is set, the declared directories will be used instead.

  COMMANDS
    fetch  Execute 'git fetch --prune --all' for all found repositories
    pull   Execute 'git pull' for all found repositories which are behind upstream

  OPTIONS
    -p, --path  PATH  Use PATH for searching Git repositories
    -h, --help        Show this help message and exit

Installation

Manual

Place the gis script in your $PATH. To use the autocompletion feature source the gis_completion.bash script.

On ZSH additionally the compinit and bashcompinit modules must be loaded before sourcing the completion script:

  autoload -U +X compinit && compinit
  autoload -U +X bashcompinit && bashcompinit

Scripts

Installation scripts for Bash (install.bash) and ZSH (install.zsh) are provided which will link the two files to ~/.local/{bin/gis,share/bash-completion/completions/gis} and add the corresponding entries to ~/.bashrc or ~/.zshrc. Further updates of gis require just git pull.

Nix Flake

This repository is also a Nix Flake. gis is provided as package under github:Deleh/gis#gis.

Syntax

  $ - Dirty stash
  ? - Untracked files
  ! - Local changes
  + - Staged changes
  - - File removed
  = - Both modified
  ⇕ - Diverged from upstream
  ⇡ - Ahead upstream
  ⇣ - Behind upstream
  ✗ - Upstream gone

Branches which don't have the same name as the origin/HEAD reference are highlighted in yellow. You can manually check on which branch you working tree is on by executing the following command:

git symbolic-ref refs/remotes/origin/HEAD

Note, that the reference gets only set when the repository is initially cloned and doesn't update with git fetch. It can be updated manually like this:

git remote set-head origin -a

Or set it manually to any branch with:

git remote set-head origin <branch_name>