Gitalias
Git alias commands for faster easier version control
Install / Use
/learn @GitAlias/GitaliasREADME
Git Alias
What is Git Alias?
Git Alias is a collection of git version control alias settings that can help you work faster and better. Git Alias provides short aliases such as s for status, command aliases such as chart and churn, lookup aliases such as whois and whatis, workflow aliases such as topic-begin for feature branch development, and more.
Setup
You can use Git Alias various ways:
-
Download the Git Alias file here: gitalias.txt.
-
Install Git Alias via a variety of ways: install guide.
-
Customize Git Alias aliases as you wish: customize guide.
Follow us
You can follow us on GitHub:
-
Git Alias account: https://github.com/gitalias
-
Git Alias repository: https://github.com/gitalias/gitalias
Short aliases
Short aliases are for frequent commands and options:
git add:
git branch:
- git b = branch
- git bm = branch --merged
- git bnm = branch --no-merged
- git bed = branch --edit-description
- git bsd = branch --show-description (polyfill)
git commit:
- git c = commit
- git ca = commit --amend
- git cam = commit --amend --message
- git cane = commit --amend --no-edit
- git caa = commit --amend --all
- git caam = commit --amend --all --message
- git caane = commit --amend --all --no-edit
- git ci = commit --interactive
- git cm = commit --message
git checkout:
git cherry-pick:
- git cp = cherry-pick
- git cpa = cherry-pick --abort
- git cpc = cherry-pick --continue
- git cpn = cherry-pick -n (--no-commit)
- git cpnx = cherry-pick -n -x (--no-commit and with a message)
git diff:
- git d = diff
- git dd = diff with our preferred settings
- git dc = diff --cached
- git ds = diff --staged
- git dwd = diff --word-diff
git fetch:
git grep:
git log:
- git l = log
- git ll = log list with our preferred short settings
- git lll = log list with our preferred long settings
- git lg = log --graph
- git lo = log --oneline
- git lor = log --oneline --reverse
- git lp = log --patch
- git lfp = log --first-parent
- git lto = log --topo-order
git ls-files:
- git ls = ls-files
- git lsd = ls-files --debug
- git lsfn = ls-files --full-name
- git lsio = ls-files --ignored --others --exclude-standard
git merge:
- git m = merge
- git ma = merge --abort
- git mc = merge --continue
- git mncnf = merge --no-commit --no-ff
git pull:
git rebase:
- git rb = rebase
- git rba = rebase --abort
- git rbc = rebase --continue
- git rbs = rebase --skip
- git rbi = rebase --interactive
- git rbiu = rebase --interactive @{upstream}
git reflog:
- git rl = reflog
git remote:
git revert:
git show-branch:
git submodule:
- git sm = submodule
- git smi = submodule init
- git sma = submodule add
- git sms = submodule sync
- git smu = submodule update
- git smui = submodule update --init
- git smuir = submodule update --init --recursive
git status:
git whatchanged:
- git w = whatchanged
Friendly aliases
Recommended helpers:
- git initer - Initialize a repo using our recommended way i.e. with an empty rebaseable commit
- git cloner - Clone a repo using our recommended way i.e. recursive include of submodules
- git pruner - Prune a repo using our recommended way i.e. prune everything unreachable now
- git repacker - Repack a repo our recommended way i.e. as Linus Torvalds describes
- git optimizer - Optimize a repo using our recommended way i.e. by pruning and repacking
Quick highlights:
- git chart - Show highlights chart of activity per author
- git churn - Show log of files that have many changes
- git summary - Show a summary of overview metrics
Branch names:
- git default-branch - Show the default branch name
- git current-branch - Show the current branch name
- git upstream-branch - Show the upstream branch name
- git topic-base-branch - Show the topic base branch name
Branch commits:
- git branch-commit-first - Show a branch's first commit hash (or hashes)
- git branch-commit-last - Show a branch's last commit hash (or hashes)
- git branch-commit-prev - Show a branch's previous commit hash (or hashes)
- git branch-commit-next - Show a branch's next commit hash (or hashes)
Friendly plurals:
- git aliases - List aliases
- git branches - List branches
- git tags - List tags
- git stashes - List stashes
Undo:
- git uncommit = reset --soft HEAD~1
- git unadd = reset HEAD
Logging & reporting:
Lookups:
- git whois - Try to figure out an author's information
- git whatis - Try to figure out an object's information
Commit details:
- git commit-parents - Show the commit's parents
- git commit-is-merge - Is the commit a merge commit?
- git commit-message-key-lines
Add all & edit all:
- git add-* - Add all files of a given type
- git edit-* - Edit all files of a given type
Alias helpers:
- git alias - Show help for git alias commands
- git add-alias - Create a new git alias
- git move-alias - Rename an existing git alias
Script helpers:
Remotes:
- git remotes-prune - For each remote branch, prune it
- git remotes-push - For each remote branch, push it
New repos:
- git init-empty - Initialize a repo with an empty rebaseable commit
- git clone-lean - Clone a repo as lean as possible
Hew branches:
- git hew - Delete all branches that are merged into a commit
- git hew-dry-run - Delete all branches that are merged into a commit (dry run)
- git hew-local - Delete local branches that are merged into a commit
- git hew-local-dry-run - Delete local branches that are merged (dry run)
- git hew-remote - Delete remote branches that are merged into a commit
- git hew-remote-dry-run - Delete remote branches that are merged into a commit (dry run)
Saving work:
- git archive - Create an archive file of everything in the repo
- git snapshot - Stash a snapshot of your current working tree
- git panic - When you're worried the world is coming to an end
Misc:
- git init-empty - Initialize a repo with an empty rebaseable commit
- [git diff-*]
