Skip to content

Instantly share code, notes, and snippets.

@davidnormo
Last active February 8, 2023 13:02
Show Gist options
  • Save davidnormo/52eb8a325706959f63fd2be0bba390e5 to your computer and use it in GitHub Desktop.
Save davidnormo/52eb8a325706959f63fd2be0bba390e5 to your computer and use it in GitHub Desktop.
.gitconfig
[user]
name = Dave Normington
email = <[email protected]> # <--- change this
[alias]
wipe = reset --hard head
l = log --pretty=format:'%C(yellow)%h %Cred%ad %Cblue%an%Cgreen%d %Creset%s' --date=short
out-bw = log --pretty=format:'%h %ad %an%d %s' --date=short --no-color
last = log -1 HEAD
ch = checkout
co = commit
coa = commit -a --amend --no-edit
coanv = commit -a --amend --no-edit --no-verify
br = branch
st = status
st-last = diff head^ --name-only
cp = cherry-pick
r = rebase
rc = "!f(){ git add . && git rebase --continue; }; f"
ra = rebase --abort
pop = reset --soft head^
cut = reset --hard head^
dno = diff --name-only
cobr = "!f(){ git commit -am \"$(git symbolic-ref --short head | cut -d '/' -f 1) $@\"; }; f"
# fetch and update master
update = "!f(){ git fetch -apt; git ch master; git merge origin/master; git ch -; }; f"
# list files with date of last commit: git ls-files-dated <path>
ls-files-dated = "!f() { git ls-files $1 | xargs -I{} sh -c \"git log --format='%aD {}' {} | head -n1\"; }; f"
# Deletes local branches if remote branch doesn't exist
prune-local-branches = "!f() { git fetch -apt; git branch -vv | grep ': gone]' | grep -v \"\\*\" | awk '{ print $1; }' | xargs git br -D; }; f"
[push]
default = current
[core]
fileMode = true
[credential]
helper = osxkeychain
[pager]
branch = false
[pull]
ff = only
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment