A generic shortcut tool for Git, written in TypeScript. Supports Windows and Linux (WSL).
- Clone the repository.
- Run
npm install. - Run
npm run build. - Run
npm install -g .
To use the short commands (e.g. ga, gc), you need to add aliases to your shell configuration.
Automatic Setup (Linux/macOS):
git-shortcuts installThis will append the necessary aliases to your .bashrc.
Manual Setup: Run:
git-shortcuts init [bash|zsh|powershell]Copy the output and append it to your .bashrc, .zshrc, or PowerShell profile.
The following shortcuts are available (once aliases are configured):
ga [files...]: Git Add. Supports numeric selection fromgs.gc <message>: Git Commit. Takes the message as arguments (no quotes needed).gam: Git Commit --amend --no-edit.gp: Git Push.gco [branch]: Git Checkout. Supports numeric selection fromgb.gb: Git Branch. Lists branches with numbers.gs: Git Status. Lists files with numbers.gu [files...]: Git Unstage (reset/rm --cached). Supports numeric selection.gd [files...]: Git Diff. Supports numeric selection.
Commands like ga, gco, gu, gd support numeric arguments referencing the index shown in gs (status) or gb (branch).
Example:
$ gs
...
# modified: [1] src/main.ts
# modified: [2] package.json
$ ga 1 2
# Adds src/main.ts and package.json