A collection of Nushell tools to manage git
repositories.
π‘ what is nu-git-manager
[toc]
like ghq
, nu-git-manager
aims at being a fully-featured
repository manager, purely written in Nushell.
it provides two main modules:
nu-git-manager
itself which ships the maingm
commandnu-git-manager sugar
which exports a bunch of Git-related tools, e.g. to help use thegh
command or augment the capabilities ofgit
π requirements [toc]
- Nushell 0.85.1+
- with Cargo and
cargo install nu
- with Cargo and
git
2.34.1- with Pacman and
pacman -S extra/git
- with Nix and
nix run nixpkgs#git
- with Pacman and
gh
(optional) 2.29.0 (used bysugar gh
)- with Pacman and
pacman -S community/github-cli
- with Nix and
nix run nixpkgs#gh
- with Pacman and
β»οΈ installation [toc]
- install Nupm (recommended) by following the Nupm instructions
- download the
nu-git-manager
repository
git clone https://github.com/amtoine/nu-git-manager
- activate the
nupm
module withuse nupm
- install the
nu-git-manager
package
nupm install --path --force nu-git-manager
βοΈ usage [toc]
in your config.nu
you can add the following to load nu-git-manager
modules:
# config.nu
# load the main `gm` command
use nu-git-manager [gm, "gm clone", "gm list", "gm root", "gm remove"]
# the following are non-essential modules
use nu-git-manager sugar git # augmnet Git with custom commands
use nu-git-manager sugar gh # load commands to interact with *GitHub*
use nu-git-manager sugar gist # load commands to interact with *GitHub* gists
then you have access to the whole nu-git-manager
suite π₯³
π getting help [toc]
do not hesitate to run one of the following to have more information about what nu-git-manager
has to offer π
help gm
# or
gm
help modules git
help modules gh
help modules gist
# or
gist
β some ideas of advanced (?) usage [toc]
everytime i open a terminal, i use Tmux to manage sessions, switch between them, detach and reattach, quite a BLAZZINGLY FAST workflow for my taste π
to achieve this, i use the tmux-sessionizer.nu
script from the nu-goat-scripts
package, again installed with Nupm π
then, in my Tmux config, i have a binding to
- list all my Git repositories
- fuzzy-pick one of them with the
main
command oftmux-sessionizer.nu
- create or reattach to the session associated with the repository
# ~/.config/tmux/tmux.conf
NUPM_HOME="~/.local/share/nupm"
TMUX_SESSIONIZER="$NUPM_HOME/scripts/tmux-sessionizer.nu"
bind-key -r t display-popup -E "nu --commands '
use $NUPM_HOME/modules/nu-git-manager *;\
$TMUX_SESSIONIZER (gm list --full-path) --short\
'"