Skip to content

frxstrem/git-aliases

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Git aliases

Run sh ./install.sh to install all.

git co

Shorthand for git checkout

git config --global alias.co checkout

git br

Shorthand for git branch

git config --global alias.br branch

git undo

Shorthand for git reset --hard

git config --global alias.undo 'reset --hard'

git info

Show a nicely formatted summary of an object

git config --global alias.info 'show --stat --pretty=format:'"'"'%C(yellow)%H%Cblue%d%n%Creset%B%Cgreen%cr %C(cyan)by %Cred%an <%ae>%Creset%n%C(yellow)PGP: %C(bold)[%G?] %GS%Creset%n'"'"''

git lg

git log with a tree graph

git config --global alias.lg 'log --graph --date-order --pretty=format:'"'"'%C(yellow)%h %C(bold)%G?%Creset %s%Cblue%d%Creset'"'"''

git ll

git log with a detailed oneline summary

git config --global alias.ll 'log --date-order --pretty=format:'"'"'%C(yellow)%h %C(bold)%G? %Creset%C(cyan)[%Cgreen%ad%C(cyan) by %Cred%an%C(cyan)]%Creset %s%Cblue%d%Creset'"'"' --date=format:'"'"'%e %b %Y %H:%M'"'"''

git changes

Show a list of changed files

git config --global alias.changes 'diff --name-status -r'

git stat

Show file change stats

git config --global alias.stat 'diff --stat -r'

git squash

Squash commits

git config --global alias.squash '!f() { [ $# -gt 0 ] || { false; exit; }; git reset --soft "$1" && { shift; git commit "$@"; }; }; f'

git head

Show current commit

git config --global alias.head 'log -n 1 HEAD --date-order --pretty=format:'"'"'%C(yellow)%h %C(bold)%G? %Creset%C(cyan)[%Cgreen%ad%C(cyan) by %Cred%an%C(cyan)]%Creset %s%Cblue%d%Creset'"'"' --date=format:'"'"'%e %b %Y %H:%M'"'"''

git gpginfo

Show GPG signature for current commit

git config --global alias.gpginfo 'show --pretty=format:'"'"'%C(yellow)%H%Creset%n%GG'"'"''

git amend

Amend previous commit

git config --global alias.amend 'commit --amend'

git pushup

Push to origin

git config --global alias.pushup '!git push -u origin $(git rev-parse --abbrev-ref HEAD)'

Releases

No releases published

Packages

No packages published