re: The Git Aliases That Get Me To Friday VIEW POST


Nice. Here are a handful of my favorites (where we don't overlap):

# What was the last commit
last=log --name-status -1 HEAD

# History of a file
history=!git log --follow --pretty=format:"$(git config --get" --

#Nicer logs
ls=!git log --pretty=format:"$(git config --get" --decorate
ll=!git log --pretty=format:"$(git config --get" --decorate --name-status
graph=!git log --graph --abbrev-commit --decorate --pretty=format:"$(git config --get custom.formats.graph)"

# My version of the alias command
la=!git config -l | grep alias | cut -c 7-

# Where am I?
where=rev-parse --abbrev-ref HEAD

# Pop off that last commit
undo=reset HEAD~1 --mixed

st=status --short

# What do I have locally that's not on the server?
out=!git log --branches="*$(git rev-parse --abbrev-ref HEAD)" --not --remotes=* --pretty=format:"$(git config --get" --decorate

# List my formats
formats=!git config -l | grep "^custom.formats" | cut -c 16-

The formats associated with above:

    ls   = "[%C(auto,yellow)%<|(10)%h%C(reset)] [%C(auto,bold blue)%<(15trunc)%cn%C(reset)]  %C(auto)%d% C(reset)%s"
    find = "[%C(yellow)%<|(20)%h%C(reset)] [%C(bold blue)%<(10)%cn%C(reset)]  %C(auto)%d %C(reset)  %s"
    graph="%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset) %C(bold yellow)%d%C(reset)%n %C(white)%s%C(reset)%n %C(dim white)- %an <%ae> %C(reset) %C(dim white)(committer: %cn <%ce>)%C(reset)"
code of conduct - report abuse