Skip to content

Instantly share code, notes, and snippets.

@GaetanoPiazzolla
Last active October 14, 2020 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GaetanoPiazzolla/3715ea8836154a84a545b97f62769300 to your computer and use it in GitHub Desktop.
Save GaetanoPiazzolla/3715ea8836154a84a545b97f62769300 to your computer and use it in GitHub Desktop.
The best GIT aliases ever
[user]
name = gpiazzolla
email = gae.xx@gmail.com
[alias]
search = ! git branch -a | sed '/->/d' | sed 's/\\*//' | xargs git grep -n -I
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
last = log -1 head
rehard = reset --hard
branches = branch -la
rank = shortlog -sn --no-merges
emergency = "!f() { git checkout -b "emergency" && git add . && git commit -m \"fixed issue\" && git push; }; f"
cleanup = "!f() { git branch --merged ${1:-master} | egrep -v \"(^\\*|${1:-master})\" | xargs --no-run-if-empty git branch -d; };f"
@GaetanoPiazzolla
Copy link
Author

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