Skip to content

Instantly share code, notes, and snippets.

@titanwalking
Created July 15, 2020 09:50
Show Gist options
  • Save titanwalking/e1128049aee4bdffd218e182baefeb0d to your computer and use it in GitHub Desktop.
Save titanwalking/e1128049aee4bdffd218e182baefeb0d to your computer and use it in GitHub Desktop.
# How to create one
git config --global alias.x y
# pretty & informative log
* lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
# update all branches before doing new work
* updateAll = !git pull --rebase --prune $@ && git submodule update --init --recursive
# usual commit
* cam = !git add -A && git commit -m
# abandon current work, but make it reachable by 'git reflog'
* wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard
# save current uncompleted changes, you will continue after a coffee break with 'continue' command (below)
* save = !git add -A && git commit -m 'SAVEPOINT'
# continue latest uncompleted changes commit (above)
* continue = reset HEAD~1 --mixed
# show which files are changed
* diffst = diff --name-only
# simple but really efficient to minimize the size of a diff
* wdiff = diff --word-diff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment