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:
Follow us
You can follow us on GitHub:
Short aliases
Short aliases are for frequent commands and options:
git add:
git branch:
git commit:
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 fetch:
git grep:
- git g = grep
- git gg = grep with our preferred settings
- git gn = grep -n (--line-number)
git log:
git ls-files:
git merge:
git pull:
git rebase:
git reflog:
git remote:
git revert:
git show-branch:
git submodule:
git status:
git 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:
Branch commits:
Friendly plurals:
Undo:
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:
Add all & edit all:
Alias helpers:
Script helpers:
- git top - Get the top level directory name
- git exec - Execute a shell script
Remotes:
New repos:
Hew branches:
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:
Advanced aliases:
Workflow aliases
Topic branching for feature workflows:
Flow aliases:
reset & undo:
- git reset-* - Move backwards on the commit chain; synonym for undo-*
- git undo-* - Move backwards on the commit chain; synonym for reset-*
track & untrack:
- git track - Start tracking from a local branch to upstream branch
- git untrack - Stop tracking from a local branch to upstream branch
inbound & outbound:
pull1 & push1:
Misc:
Tooling aliases
Use gitk:
Use other version control systems:
Use graphviz:
Index of all aliases
- git a - Short for "git add"
- git aa - Short for "git add --all" - Add all paths
- git add-alias - Create a new git alias
- git add-cached - Add cached files
- git add-deleted - Add deleted files
- git add-ignored - Add ignored files
- git add-killed - Add killed files
- git add-modified - Add modified files
- git add-others - Add other files
- git add-stage - Add stage files
- git add-unmerged - Add unmerged files
- git aliases - List git aliases
- git ap - Short for "git add --patch" - Add by patch
- git archive - Create an archive file of everything in the repo
- git assume-all - Assume all files are unchanged
- git assume - Assume files are unchanged
- git assumed - Show which files are assumed
- git au - Short for "git add --update"
- git b - Short for "git branch"
- git bed - Edit the description of a branch
- git bm - List branches whose tips are reachable from the specified commit (HEAD if not specified)
- git bnm - List branches whose tips are not reachable from the specified commit (HEAD if not specified)
- 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-next - Show a branch's next commit hash (or hashes)
- git branch-commit-prev - Show a branch's previous commit hash (or hashes)
- git branch - Aliases related to git branch
- git branches - List branches
- git bsd - Show the description of a branch
- git bv - List branch information with hash and subject
- git bvv - List branch information with hash and subject and upstream
- git c - Short for "git commit"
- git ca - Amend the tip of the current branch; do not create a new commit
- git cam - Amend the tip of the current branch; edit the message
- git cane - Amend the tip of the current branch; do not edit the message
- git caa - Amend the tip of the current branch, automatically staging files that have been modified and deleted
- git caam - Amend the tip of the current branch, staging files, and edit the message
- git caane - Amend the tip of the current branch, staging files, and do not edit the message
- git chart - Show highlights chart of activity per author
- git cherry-pick-merge - Cherry pick a merge commit
- git churn - Show log of files that have many changes
- git ci - Commit interactive
- git cleaner - Clean a working tree using more power options
- git cleanest - Clean a working tree using the most power options
- git cleanout - Clean a working tree using typical options then checkout
- git clone-lean - Clone as lean as possible
- git cloner - Clone a repository and recurse on any of its submodules
- git cm - Commit with a message
- git co - Checkout a.k.a. update the working tree to match a branch or paths
- git cog - Checkout with guessing
- git cong - Checkout with no guessing
- git cob - Create a new branch from the current working tree, and switch to it
- git commit-is-merge - Is the commit a merge commit? If yes exit 0, else exit 1
- git commit-message-key-lines - Show the commit's keyword-marker lines
- git commit-parents - Show the commit's parents
- git cong - Checkout with no guessing
- git count -
- git cp - Cherry-pick - apply the changes introduced by some existing commits;
- git cpa - Abort the cherry-pick process
- git cpc - Continue the cherry-pick process
- git cpn - Cherry-pick with no commit
- git cpnx - Cherry-pick with no commit and with explanation
- git current-branch - Get the current branch name
- git hew - Delete branches that have been merged into a commit
- git hew-dry-run - Delete branches that have been merged into a commit (dry run)
- git hew-local - Delete local branches that have been merged into a commit
- git hew-local-dry-run - Delete local branches that have been merged into a commit (dry run)
- git hew-remote - Delete remote branches that have been merged into an upstream commit
- git hew-remote-dry-run - Delete remote branches that have been merged into an upstream commit (dry run)
- git cvs-e - CVS export
- git cvs-i - CVS import
- git d - Short for "git diff"
- git dc - Diff in order to show changes not yet staged
- git dd - Diff deep - show changes with our preferred options
- git debug - Help debugging builtins
- git default-branch - Get the default branch name
- git diff-all - For each diff, call difftool
- git diff-changes - Show diff of changes
- git diff-chunk - Show the diff of one chunk
- git diff-deep - Diff with deep information using our preferred options, a.k.a.
dd
- git diff-staged - Show diffs that are cached i.e. staged
- git diff-stat - Diff with stat
- git discard - Discard changes in a file (or a list of files) in working tree
- git ds - Show changes about to be committed
- git dw - Show changes by word, not line
- git edit-cached - Edit cached files
- git edit-deleted - Edit deleted files
- git edit-ignored - Edit ignored files
- git edit-killed - Edit killed files
- git edit-modified - Edit modified files
- git edit-others - Edit other files
- git edit-stage - Edit stage files
- git edit-unmerged - Edit unmerged files
- git exec - Execute a shell script
- git expunge - Delete a file everywhere
- git f - Short for "git fetch"
- git fa - Fetch all remotes
- git fav - Fetch all remotes, with verbose output
- git fixup - Fix a commit by amending it
- git g - Short for "git grep"
- git get - Get all changes for the current branch
- git gg - Grep group i.e. search with our preferred options
- git gitk-conflict - Use gitk tool to show conflicting merge
- git gitk-history-all - Use gitk tool to show full history
- git gn - Grep and show line number
- git graphviz - Use graphviz tool for display
- git grep-ack -
- git grep-all - Find text in any commit ever
- git grep-group - Find text and group the output lines, a.k.a.
gg
- git heads - Show log of heads
- git ignore - Ignore all untracked files by appending them to ".gitignore"
- git inbound - Show incoming changes compared to upstream
- git init-empty - Initialize a repo with an empty rebaseable commit
- git initer - Initialize a repo using our recommended way i.e. with an empty rebaseable commit
- git intercommit - Use interdiff to see patch modifications
- git issues - List all issues mentioned in commit messages between range of commits
- git l - Short for "git log"
- git last-tag - Show the last tag in the current branch
- git last-tagged - Show the last annotated tag in all branches
- git lfp - Show log with first parent
- git lg - Show log with a text-based graphical representation of the commit history
- git ll - Log list - Show log list with our preferred options and short information
- git lll - Log list long - Show log list with our preferred options and long information
- git lo - Show log with one line per item
- git log-1-day - Show log with the recent day
- git log-1-hour - Show log with the recent hour
- git log-1-month - Show log with the recent month
- git log-1-week - Show log with the recent week
- git log-1-year - Show log with the recent year
- git log-date-first - Show the date of the earliest commit, in strict ISO 8601 format
- git log-date-last - Show the date of the latest commit, in strict ISO 8601 format
- git log-fetched - Show log of fetched commits vs. origin/main
- git log-fresh - Show log of new commits after you fetched, with stats, excluding merges
- git log-graph -
- git log-list - Show log list with our preferred options and short information
- git log-list-long - Show log list with our preferred options and long information
- git log-my - Show log with my own commits by my own user email
- git log-my-day - Show log with my own recent day
- git log-my-hour - Show log with my own recent hour
- git log-my-month - Show log with my own recent month
- git log-my-week - Show log with my own recent week
- git log-my-year - Show log with my own recent year
- git log-of-count-and-day - Show log with count and day
- git log-of-count-and-day-of-week - Show log with count and day of week
- git log-of-count-and-email - Show log with count and email
- git log-of-count-and-format - Show log with count and custom format string
- git log-of-count-and-format-with-date - Show log with count and custom format string and date
- git log-of-count-and-hour - Show log with count and hour
- git log-of-count-and-hour-of-day - Show log with count and hour of day
- git log-of-count-and-month - Show log with count and month
- git log-of-count-and-week - Show log with count and week
- git log-of-count-and-week-of-year - Show log with count and week of year
- git log-of-count-and-year - Show log with count and year
- git log-of-day-and-count - Show log with day and count
- git log-of-day-of-week-and-count - Show log with week and count
- git log-of-email-and-count - Show log with email and count
- git log-of-format-and-count - Show a specific format string and count of log entries
- git log-of-format-and-count-with-date - Show log with custom format string and count with date
- git log-of-hour-and-count - Show log with hour and count
- git log-of-hour-of-day-and-count - Show log with hour of day and count
- git log-of-month-and-count - Show log with month and count
- git log-of-week-and-count - Show log with week and count
- git log-of-week-of-year-and-count - Show log with week of year and count
- git log-of-year-and-count - Show log with year and count
- git log-refs - Show log with commits that are referred by some branch or tag
- git log-timeline -
- git lp - Show log with patch generation
- git ls - List files in the index and the working tree; like Unix "ls" command
- git lsd - List files and show debug information
- git lsfn - List files and show full name
- git lsio - List files that git is ignoring
- git lto - Show log with items appearing in topological order
- git m - Short for "git merge"
- git ma - Merge abort i.e. abort the merge process
- git mainly - Make local like main
- git mc - Merge continue i.e. continue the merge process
- git mncnf - Merge with no autocommit, and with no fast-forward
- git merge-span - Merge span aliases
- git merge-span-diff - Show the changes that were introduced by a merge
- git merge-span-difftool - Show the changes that were introduced by a merge, in your difftool
- git merge-span-log - Find the commits that were introduced by a merge
- git move-alias - Rename an existing git alias
- git o - Short for "git checkout"
- git optimizer - Optimize the repository by pruning and repacking
- git orphans - Find all objects that aren't referenced by any other object
- git ours - Checkout our version of a file and add it
- git outbound - Show outgoing changes compared to upstream
- git p - Short for "git pull"
- git panic - When you're a little worried that the world is coming to an end
- git pf - Pull if a merge can be resolved as a fast-forward, otherwise fail
- git pr - Pull with rebase i.e. provide a cleaner, linear, bisectable history
- git prp - Pull with rebase preserve of merge commits
- git pruner - Prune everything that is unreachable now
- git publish - Publish the current branch
- git pull1 - Pull just the one current branch
- git push1 - Push just the one current branch
- git pushy - Push with force and lease
- git put - Put all changes for the current branch
- git rb - Short for "git rebase"
- git rba - Rebase abort i.e. abort the rebase process
- git rbc - Rebase continue i.e. continue the rebase process
- git rbi - Rebase interactive i.e. do a rebase with prompts
- git rbiu - Rebase interactive on unpushed commits
- git rbs - Rebase skip i.e. restart the rebase process by skipping the current patch
- git rebase-branch - Interactively rebase all the commits on the current branch
- git rebase-recent - Rebase recent commits with interactive
- git refs-by-date - Show refs sorted by date for branches
- git reincarnate - Delete a branch then create it anew
- git remote-ref - TODO
- git remotes-prune - For each remote branch, prune it
- git remotes-push - For each remote branch, push it
- git repacker - Repack a repo as recommended by Linus
- git reset-commit - Reset a commit with a soft reset
- git reset-commit-hard - Reset a commit with a hard reset
- git reset-commit-hard-clean - Reset a commit with a hard reset and a clean
- git reset-to-pristine - Reset commits and clean all differences
- git reset-to-upstream - Reset commits back to the upstream branch
- git rev-list-all-objects-by-size-and-name - List all objects by size in bytes and file name
- git rev-list-all-objects-by-size - List all blobs by size in bytes
- git rl - Short for "git reflog"
- git rr - Short for "git remote"
- git rrp - Remote prune i.e. delete all stale remote-tracking branches under
- git rrs - Remote show i.e. give information about the remote
- git rru - remote update i.e. fetch updates for a named set of remotes in the repository as defined by remotes
- git rv - Short for "git revert"
- git rvnc - Revert with no commit i.e. without autocommit
- git s - Short for "git status"
- git sb - Short for "git show-branch" i.e. print a list of branches and their commits
- git search-commits - Search for a given string in all patches and print commit messages
- git serve - Serve the local directory by starting a git server daemon
- git show-unreachable - Show logs of unreachable commits
- git sm - Short for "git submodule"
- git sma - Submodule add i.e. add a submodule to this repo
- git smi - Submodule init i.e. initialize a submodule in this repo
- git sms - Submodule sync i.e. synchronize a submodule in this repo
- git smu - Submodule update i.e. update a submodule in this repo
- git smui - Submodule update with initialize
- git smuir - Submodule update with initialize and recursive; this is useful to bring a submodule fully up to date
- git snapshot - Take a snapshot of your current working tree
- git ss - Status with short format
- git ssb - Status with short format and branch info
- git stashes - List stashes
- git summary - Show a summary of overview metrics
- git svn-b - Subversion branch
- git svn-c - Subversion commit
- git svn-cp - Subversion cherry pick
- git svn-m - Subversion merge
- git tags - List tags
- git theirs - Checkout their version of a file and add it
- git top - Get the top level directory name
- git topic-* - Read this first about topic aliases
- git topic-base-branch - Show the project base topic branch name
- git topic-move - Rename the current topic branch
- git topic-begin - Start a new topic branch
- git topic-end - Finish the current topic branch
- git topic-sync - Synchronize the current topic branch by doing updates
- git track-all-remote-branches - Track all remote branches that aren't already being tracked
- git track - Start tracking a branch, with default parameters, and showing the command
- git unadd - Reset something that's been added
- git unassume-all - Unassume all files
- git unassume - Unassume files
- git uncommit - Reset one commit
- git undo-commit - Undo a commit with a soft reset
- git undo-commit-hard - Undo a commit with a hard reset
- git undo-commit-hard-clean - Undo a commit with a hard reset and a clean
- git undo-to-pristine - Undo commits and clean all differences
- git undo-to-upstream - Undo commits back to the upstream branch
- git unpublish - Unpublish the current branch
- git untrack - Stop tracking a branch, with default parameters, and showing the command
- git unwip - Load "work in progress"
- git upstream-branch - Get the upstream branch name
- git w - Short for "git whatchanged"
- git whatis - Given a git object, try to show it briefly
- git who - Show a short log of who has contributed commits, in descending order
- git whois - Given a string for an author, try to figure out full name and email
- git wip - Save "work in progress"
Tracking
- Package: gitalias
- Version: 28.0.1
- Created: 2016-06-17T22:05:43Z
- Updated: 2023-05-31T11:39:14Z
- License: GPL-2.0-or-later or contact us for custom license
- Contact: Joel Parker Henderson (joel@joelparkerhenderson.com)