Skip to content

Instantly share code, notes, and snippets.

@asafmaoz1234
Last active August 15, 2018 09:11
Show Gist options
  • Save asafmaoz1234/ef1981e749719ef1be33814a12de6d7c to your computer and use it in GitHub Desktop.
Save asafmaoz1234/ef1981e749719ef1be33814a12de6d7c to your computer and use it in GitHub Desktop.
useful git aliases to improve CLI experience (some more useful then others)
# HOW to set:
# git config --global --replace-all alias.clist 'config --list'
alias.cm=commit -m
alias.cb=checkout -b
alias.st=status
alias.br=branch
alias.ms=merge --squash
alias.ch=checkout
alias.cam=commit -a -m
alias.clist=config --list
alias.ap=add -p
alias.ds=diff --staged
alias.slist=stash list
alias.ssave=stash save
alias.brl=branch --list
alias.cmamne=commit --amend --no-edit
alias.rebasebr=!f() { BR_NAME=$(git rev-parse --abbrev-ref HEAD); git checkout $1; git pull; git checkout $BR_NAME; git rebase $1; }; f
alias.pushfo=!f() { BR_NAME=$(git rev-parse --abbrev-ref HEAD); git push -f origin $BR_NAME; }; f
credential.helper=cache --timeout=3600
push.default=simple
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment