Skip to content

Instantly share code, notes, and snippets.

@ryanmaffey
Last active April 16, 2020 15:08
Show Gist options
  • Save ryanmaffey/b7a52b72b3c2eccba86a2a8f56b3ada0 to your computer and use it in GitHub Desktop.
Save ryanmaffey/b7a52b72b3c2eccba86a2a8f56b3ada0 to your computer and use it in GitHub Desktop.
Git Config Aliases
[http]
sslVerify = false
[user]
name = Ryan Maffey
email = ryan.maffey@gmail.com
[pull]
rebase = true
[winUpdater]
recentlySeenVersion = 2.26.0.windows.1
[alias]
leaderboard = shortlog -sn --all --no-merges
recent-branches = for-each-ref --count=10 --sort=-committerdate refs/heads/ --format="%(refname:short)"
recent-commits = log --all --oneline --no-merges --author=ryan.maffey@gmail.com
today = log --since=00:00:00 --all --no-merges --oneline --author=ryan.maffey@gmail.com
lg = log --graph --all --decorate --stat --date=iso
stat = !git fetch && git status
cb = checkout -b
# LOCAL-ONLY
# List all local branches whcih do not exist on remote (excludes current branch).
# https://medium.com/@kcmueller/delete-local-git-branches-that-were-deleted-on-remote-repository-b596b71b530c
local-only = "!f() { git branch -vv | grep ': gone]' | grep -v "\\*" | awk '{ print $1; }'; }; f"
# === DANGER ZONE ===
# NUKE-LOCAL-ONLY
# Deletes all local branches whcih do not exist on remote (excludes current branch).
# https://medium.com/@kcmueller/delete-local-git-branches-that-were-deleted-on-remote-repository-b596b71b530c
# nuke-local-only = "!f() { git branch -vv | grep ': gone]' | grep -v "\\*" | awk '{ print $1; }' | xargs -r git branch -D; }; f"
# nuke-remote = "!f() { git push origin --delete $1 && git branch -a; }; f"
# nuke-local = "!f() { git branch -D $1 && git branch -a; }; f"
# nuke = "!f() { git branch -D $1 && git push origin --delete $1 && git branch -a; }; f"
[filter "lfs"]
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment