Skip to content

Instantly share code, notes, and snippets.

@sungchuni
Last active January 17, 2020 10:06
Show Gist options
  • Save sungchuni/d291b97288863ede454c0d67011e48d0 to your computer and use it in GitHub Desktop.
Save sungchuni/d291b97288863ede454c0d67011e48d0 to your computer and use it in GitHub Desktop.
#!/bin/bash
git config --system alias.a "!git add . && git status" &&
git config --system alias.aa "!git add . && git add -u . && git status" &&
git config --system alias.ac "!git add . && git commit" &&
git config --system alias.acm "!git add . && git commit -m" &&
git config --system alias.alias "!git config --list | grep 'alias\.' | sed 's/alias\.\([^=]*\)=\(.*\)/\1\ => \2/' | sort" &&
git config --system alias.au "!git add -u . && git status" &&
git config --system alias.c "commit" &&
git config --system alias.ca "commit --amend" &&
git config --system alias.cm "commit -m" &&
git config --system alias.d "diff" &&
git config --system alias.l "log --graph --all --pretty=format:'%C(yellow)%h%C(cyan)%d%Creset %s %C(white)- %an, %ar%Creset'" &&
git config --system alias.lg "log --color --graph --pretty=format:'%C(bold white)%h%Creset -%C(bold green)%d%Creset %s %C(bold green)(%cr)%Creset %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative" &&
git config --system alias.ll "log --stat --abbrev-commit" &&
git config --system alias.llg "log --color --graph --pretty=format:'%C(bold white)%H %d%Creset%n%s%n%+b%C(bold blue)%an <%ae>%Creset %C(bold green)%cr (%ci)' --abbrev-commit" &&
git config --system alias.master "checkout master" &&
git config --system alias.s "status" &&
git config --system alias.spull "svn rebase" &&
git config --system alias.spush "svn dcommit"
$ git alias
a => !git add . && git status
aa => !git add . && git add -u . && git status
ac => !git add . && git commit
acm => !git add . && git commit -m
alias => !git config --list | grep 'alias\.' | sed 's/alias\.\([^=]*\)=\(.*\)/\1\ => \2/' | sort
au => !git add -u . && git status
c => commit
ca => commit --amend
cm => commit -m
d => diff
l => log --graph --all --pretty=format:'%C(yellow)%h%C(cyan)%d%Creset %s %C(white)- %an, %ar%Creset'
lg => log --color --graph --pretty=format:'%C(bold white)%h%Creset -%C(bold green)%d%Creset %s %C(bold green)(%cr)%Creset %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
ll => log --stat --abbrev-commit
llg => log --color --graph --pretty=format:'%C(bold white)%H %d%Creset%n%s%n%+b%C(bold blue)%an <%ae>%Creset %C(bold green)%cr (%ci)' --abbrev-commit
master => checkout master
s => status
spull => svn rebase
spush => svn dcommit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment