Skip to content
rockberproPublic

About

Logical Git Aliases

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

git-lga

Logical Git Aliases

A prefix-based shorthand system that turns Git commands into muscle memory.

Two-letter prefix picks the command. One-letter suffix is the first letter of the flag.

git st  → status                git cm  → commit
git sts → status --short        git cmm → commit --message
                                git cma → commit --amend
git df  → diff
git dfc → diff --cached         git rb  → rebase
git dfi → diff --ignore-space   git rba → rebase --abort
                                git rbi → rebase --interactive
git ps  → push
git psf → push --force          git mg  → merge
git psh → push origin HEAD      git mga → merge --abort
                                git mgc → merge --continue

That's it. rbc? rebase --continue. psf? push --force. dfc? diff --cached.

Run git lga to see every alias right in your terminal:

╔═════════════════════════════════════════════════╗
║                   Git Aliases                   ║
╠═════════════════════════════════════════════════╣
║ ── A ──                                         ║
║ ad     │ add                                    ║
║ ada    │ add .                                  ║
║ adu    │ add --update                           ║
║ ── B ──                                         ║
║ bl     │ blame                                  ║
║ br     │ branch                                 ║
║ brd    │ branch --delete                        ║
║ brl    │ branch --list                          ║
║ ── C ──                                         ║
║ cm     │ commit                                 ║
║ cmm    │ commit --message                       ║
║ cma    │ commit --amend                         ║
║ cmn    │ commit --amend --no-edit               ║
║ cmf    │ commit --fixup                         ║
║ ck     │ checkout                               ║
║         ...                                     ║
║ ── S ──                                         ║
║ st     │ status                                 ║
║ sts    │ status --short --branch                ║
║ sw     │ switch                                 ║
║ swc    │ switch --create                        ║
║ sth    │ stash                                  ║
║ stha   │ stash apply                            ║
║ sthd   │ stash drop                             ║
║         ...                                     ║
╚═════════════════════════════════════════════════╝
  103 aliases across 14 groups

Install

Linux / macOS:

curl -sL https://raw.githubusercontent.com/rockberpro/git-lga/main/setup.sh | bash

Windows (PowerShell):

irm https://raw.githubusercontent.com/rockberpro/git-lga/main/setup.ps1 | iex

The setup script adds an [include] entry to ~/.gitconfig, installs shell aliases (g-prefix), and copies files to ~/. You can read the full source (setup.sh, setup.ps1) before running it, or use the manual install below.

Manual install:

curl -sL https://raw.githubusercontent.com/rockberpro/git-lga/main/git-lga.gitconfig \
  -o ~/.git-lga.gitconfig

curl -sL https://raw.githubusercontent.com/rockberpro/git-lga/main/git-lga-help.sh \
  -o ~/.git-lga-help.sh && chmod +x ~/.git-lga-help.sh

curl -sL https://raw.githubusercontent.com/rockberpro/git-lga/main/git-lga.bashrc \
  -o ~/.git-lga.bashrc

git config --global include.path ~/.git-lga.gitconfig
echo "source ~/.git-lga.bashrc" >> ~/.bashrc

The Pattern

Every alias follows the same rule: prefix (2–3 letters from the command name) + suffix (first letter of the key flag).

Prefix Command Variants
ad add ada all, adp patch, adu update
br branch bra all, brd delete, brf force delete, brl list, brm move
cm commit cmm message, cma amend, cmn no-edit, cmf fixup
ck checkout —
sw switch swc create
rs restore rsa all, rss staged
df diff dfc cached, dfi ignore-space, dfs stat, dfw word-diff
ft fetch fta all, ftp prune
pl pull plh HEAD, plr rebase
ps push psf force, psh HEAD, pshf HEAD+force, psu set-upstream
lg log lgp patch, lgo oneline graph, lgh HEAD
sh show —
mg merge mga abort, mgc continue, mgs squash
rb rebase rba abort, rbc continue, rbi interactive, rbo onto, rbs skip
sth stash stha apply, sthd drop, sthl list, stho pop, sthp push, sthc clear, sths show, sthu untracked
st status sts short
chp cherry-pick chpa abort, chpc continue, chps skip
wt worktree wta add, wtl list, wtm move, wtp prune, wtr remove
bs bisect bsb bad, bsg good, bsr reset, bss start
rst reset rsth hard, rsts soft
rv revert rva abort, rvc continue
sm submodule smu update --init --recursive

Other aliases: bl blame, cfg config, cfgl config --list, cln clean, clf clean --force, clfd clean --force -d, clo clone, ds describe, gp grep, in init, rl reflog, rt remote, rtv remote --verbose, tg tag, tgd tag --delete, brs show-current-branch.

Built-in help: lga — show all aliases in a formatted table. Printable version: CHEATSHEET.md.

Why This One?

There are hundreds of git alias collections. Here's what makes this one different:

  • Learnable, not memorizable. The prefix+suffix rule means you can guess aliases you've never seen. Most collections are arbitrary shorthand you have to look up every time.
  • git lga built-in reference. Forget an alias? One command shows them all, grouped and formatted, right in your terminal.
  • Non-invasive. Installs as a gitconfig [include] — your existing config stays untouched. Remove it with one line.
  • No dependencies. Pure gitconfig + one shell script. No plugin managers, no frameworks, no oh-my-zsh required.

Uninstall

git config --global --unset include.path ~/.git-lga.gitconfig
rm ~/.git-lga.gitconfig ~/.git-lga-help.sh ~/.git-lga.bashrc
# remove source line from ~/.bashrc manually

setup.sh · setup.ps1 · git-lga.gitconfig · git-lga-help.sh · git-lga.bashrc · git-lga.ps1

About

Logical Git Aliases

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors

Languages