Skip to content

Instantly share code, notes, and snippets.

@thomasvm
Created November 3, 2011 16:22
Show Gist options
  • Save thomasvm/1336948 to your computer and use it in GitHub Desktop.
Save thomasvm/1336948 to your computer and use it in GitHub Desktop.
Git shortcuts
#! /bin/sh
alias gs="git status"
alias gc="git commit"
alias gr="git checkout"
alias ga="git add"
alias gl="git lola"
[alias]
st = status
ci = commit
br = branch
co = checkout
df = diff
ds = diff --staged
lg = log -p
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all --date=local
logc = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
ls = ls-files
unstage = reset HEAD
# Show files ignored by git:
ign = ls-files -o -i --exclude-standard
[core]
whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol
@mathiasverraes
Copy link

I like this one as a git log replacement:

[alias]
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
... and here is how you can install it on your system:

git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"

From http://www.jukie.net/bart/blog/pimping-out-git-log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment