Custom Git subcommands implemented as executable files named git-*.
日本語版: README.ja.md
git latest <branch>- Switch to the target branch and update it from remote with fast-forward only.
git local-branch [branch-pattern]- Select a local branch with
fzfand switch to it. - If
branch-patternis provided, only matching local branches are candidates.
- Select a local branch with
git merged [-clean]- List local branches that are already merged into the current branch.
- With
-clean, delete the listed merged local branches.
git last [-n]- Show the latest commit diff.
- With
-n(positive integer), show the diff of the commitnbehindHEAD(for example-1,-2).
bashorzsh(supported interactive shell environment)gitfzf(required forgit local-branch)
Install from GitHub (default branch):
curl -fsSL https://raw.githubusercontent.com/meian/git-subcommands/main/install.sh | shUpdate an existing installation:
curl -fsSL https://raw.githubusercontent.com/meian/git-subcommands/main/install.sh | sh -s -- --updateInstall a specific branch:
curl -fsSL https://raw.githubusercontent.com/meian/git-subcommands/main/install.sh | sh -s -- --branch feature/my-branchInstall a specific tag:
curl -fsSL https://raw.githubusercontent.com/meian/git-subcommands/main/install.sh | sh -s -- --tag v1.0.0The same installation steps work regardless of your current shell (bash/zsh).
The installer configures interactive shells by adding a managed block to .bashrc and .zshrc that loads ~/.git-subcommands.rc.
~/.git-subcommands.rc adds ~/.local/share/git-subcommands/src to PATH.
After installation, you can run these as normal Git subcommands:
git latest maingit local-branch featuregit merged -cleangit last -1
Run:
curl -fsSL https://raw.githubusercontent.com/meian/git-subcommands/main/uninstall.sh | shor execute the local script:
./uninstall.shThe uninstaller removes the managed block from .bashrc and .zshrc and deletes ~/.git-subcommands.rc.
bash test/run.sh