Skip to content

Instantly share code, notes, and snippets.

@leunardo
Last active February 17, 2020 11:47
Show Gist options
  • Select an option

  • Save leunardo/0aad90110fd0ac12cf983272b9475620 to your computer and use it in GitHub Desktop.

Select an option

Save leunardo/0aad90110fd0ac12cf983272b9475620 to your computer and use it in GitHub Desktop.
Git Aliases
[alias]
# stash; checkout; pop
# git scp ->
# git stash; git checkout -; git stash pop;
scp = !git stash && git checkout - && git stash pop
# stash; checkout specific; pop
# git scsp myBrach ->
# git stash; git checkout myBranch; git stash pop;
scsp = !git stash && git checkout $1 && git stash pop && :
# branch search
bs = !git branch --all | grep $1 --ignore-case && :
# undo last commit
undo = !git reset HEAD~1
# discard all changes done
discard = !git checkout -- .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment