gfold 2.0.0

CLI tool to help keep track of your Git repositories.
gfold-2.0.0 is not a library.
Visit the last successful build: gfold-1.4.1

gfold

tag crates.io build license

gfold is a CLI-driven application that helps you keep track of multiple Git repositories.

% gfold
astrid  unclean   main       git@github.com:db/astrid.git
fev     bare      main       https://github.com/institute/fev.git
gb      unpushed  dev        https://github.com/hrothgar/gb.git
neloth  unclean   patch      git@github.com:telvanni/neloth.git
pam     clean     main       https://github.com/onc/pam.git
prime   clean     issue2287  git@github.com:bos/prime.git

Description and Motivation

This app displays relevant information for multiple Git repositories in one to many directories. While this tool might seem limited in scope and purpose, that is by design.

It prints each repository in alphabetical order, and pads each result based on the longest directory, branch, and status string. By default, gfold looks at every Git repository via traversal from the current working directory. However, if you would like to target another directory, you can pass that path (relative or absolute) as the first argument.

Installation

There are multiple methods for installing gfold.

Homebrew (macOS only)

You can use Homebrew to install the tap.

brew install nickgerace/nickgerace/gfold

Notes:

  • The original tap is still actively maintained, but is deprecated. Please migrate to the new tap.
  • Both the current and deprecated taps may not work with Linuxbrew.

AUR

You can use a Linux distribution that supports installing packages from the AUR, Arch User Respository, to install the following:

Many people choose to use an AUR helper, such as yay or paru, in order to install their AUR packages.

yay -S gfold
paru -S gfold

Cargo (recommended)

You can use cargo to install the crate on almost any platform.

cargo install gfold

Keeping the crate up to date is easy with cargo-update.

cargo install cargo-update
cargo install-update -a

Binary from a Release

If you do not want to use one of the above installation methods, you can download a binary from the releases page. The following convenience script can be used on macOS and Linux amd64 systems (requires wget, jq, and curl to be installed):

(
    OS=$(uname -s | tr '[:upper:]' '[:lower:]')
    if [ "$OS" = "linux" ]; then OS=linux-gnu; fi
    LATEST=$(curl -s https://api.github.com/repos/nickgerace/gfold/releases/latest | jq -r ".tag_name")
    wget -O gfold https://github.com/nickgerace/gfold/releases/download/$LATEST/gfold-$OS-amd64
    chmod +x gfold
    sudo mv gfold /usr/local/bin/gfold
)

Note: the above convenience script does not verify the binary with a checksum. Discretion is advised.

Usage

Pass in the -h, or --help, flag to see all the options for using this application.

gfold
gfold ..
gfold $HOME
gfold ~/
gfold /this/is/an/absolute/path
gfold ../../this/is/a/relative/path

Compatibility

gfold is intended to be ran on any tier one Rust target. Please file an issue if your platform is unsupported.

Troubleshooting

If fold from GNU Coreutils is installed on macOS via brew, it will be named gfold. You can avoid this collision with shell aliases, shell functions, and/or PATH changes. Here is an example with the o dropped from gfold:

alias gfld=$HOME/.cargo/bin/gfold