Skip to content

Instantly share code, notes, and snippets.

@TimMurphy
Last active August 29, 2015 14:07
Show Gist options
  • Save TimMurphy/c6804a46df9988d575a7 to your computer and use it in GitHub Desktop.
Save TimMurphy/c6804a46df9988d575a7 to your computer and use it in GitHub Desktop.
Git Aliases
[alias]
# References
# ----------
#
# - http://haacked.com/archive/2014/07/28/github-flow-aliases/
# update working copy before creating new branch
update = !git pull --rebase --prune $@ && git submodule update --init --recursive
# checkout a branch
cob = checkout -b
# add all untracked files and commit
cm = !git add -A && git commit -m
# add all untracked files with 'SAVEPOINT' message
save = !git add -A && git commit -m 'SAVEPOINT'
# undo the previous commit
undo = reset HEAD~1 --mixed
# amend previous commit message
amend = commit -a --amend
# A save reset
safereset = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment