Skip to content

Useful Git Aliases

Douglas Jacobsen edited this page Jun 25, 2013 · 1 revision

This is a list of useful git aliases, and the commands to define them in git.

Abbreviated status

Just abbreviates status to st. Similar things can be defined like ci can be commit, and co can be checkout.

git config --global alias.st status

usage: git st

Graph view of log in terminal

Prints a graph based log of a branch (or all branches if the --all flag is appended) on the command line. Similar to gitk.

git config --global alias.logg "log --graph --oneline --abbrev-commit --decorate"

usage: git logg

Svn style export

Exports a branch from your local repository into a directory.

git config --global alias.export "!sh -c 'git archive ${1} | tar xv -C ${2}' -"

usage: git export branch_name export_directory

Easy updating/pruning of all remote repositories

Updates remote tracking branches, and deletes remote tracking branches for branches that have been deleted.

git config --global alias.up "fetch --all -p"

usage: git up