A collection of Nushell tools to manage git
repositories.
- 💡 what is
nu-git-manager
- 🔗 requirements
- ♻️ installation
- ⚙️ usage
- 🙏 getting help
- ❗ some ideas of advanced (?) usage
💡 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.89.0
- 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
toolkit
module withuse toolkit.nu
- install the
nu-git-manager
andnu-git-manager-sugar
packages
toolkit install
- verify the installation after restarting Nushell
gm version
Note if you are using the latest stable release of Nushell, then you should install
nu-git-manager
from themain
branch, i.e. by default.if you want to use the latest and hotest builds of Nushell, either by building from source yourself or using the nightly builds, you might want to checkout the
nightly
branch and install from there. this alternative branch should contain all fixes and newest features from the latest versions of Nushell 🔥
⚙️ usage [toc]
in your config.nu
you can add the following to load nu-git-manager
modules:
# load the main `gm` command
use nu-git-manager *
# the following are non-essential modules
use nu-git-manager-sugar extra * # augment `gm` with additional commands
Note
please have a look at the documentation of NGM for more modules and commands
then you have access to the whole nu-git-manager
suite 🥳
🙏 getting help [toc]
please have a look at the documentation of NGM
❗ 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, 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\
'"