Skip to content

Instantly share code, notes, and snippets.

@yakup
Created June 25, 2018 13:46
Show Gist options
  • Save yakup/f6c9112d684f34b1d6bfea433785b6ba to your computer and use it in GitHub Desktop.
Save yakup/f6c9112d684f34b1d6bfea433785b6ba to your computer and use it in GitHub Desktop.
Git aliases
alias.co checkout
alias.st status
alias.ec config --global -e
alias.br branch -vv
alias.gr grep -i
alias.ls !git branch -r && git br
alias.up !git pull --rebase --prune $@ && git submodule update --init --recursive
alias.cob checkout origin/HEAD -b
alias.rn !f(){ git branch -m ${1}; };f
alias.task !f(){ git checkout -b t${1}/${2}/${3} origin/HEAD && git status; };f
alias.cm !git add -A && git commit -m
alias.save !git add -A && git commit -m 'SAVEPOINT'
alias.wip !git add -u && git commit -m WIP
alias.undo !f(){ git reset --soft HEAD~${1}; };f
alias.amend commit -a --amend
alias.track branch -u origin/HEAD
alias.tr !f(){ git branch -u origin/${1} && git br; };f
alias.db !f(){ git remote set-head origin ${1}; };f
alias.dt !f(){ git tag -d ${1} && git push origin :refs/tags/${1}; };f
alias.wipe !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard
alias.bclean !f() { git branch --no-track --no-color --merged ${1-dev} | grep -v ${1-dev}$ | xargs -r git branch -d; }; f
alias.bdone !f() { git checkout ${1-dev} && git up && git bclean ${1-dev}; }; f
alias.hist log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short
alias.cp cherry-pick
alias.lg log --oneline
alias.plus commit --amend -a -C HEAD
@yakup
Copy link
Author

yakup commented Jun 25, 2018

To get definder git aliases : git config --get-regexp alias

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