Skip to content

Instantly share code, notes, and snippets.

@b-dur
Last active September 4, 2023 09:47
Show Gist options
  • Save b-dur/2d58b0efa23a26a556a9400378da87ef to your computer and use it in GitHub Desktop.
Save b-dur/2d58b0efa23a26a556a9400378da87ef to your computer and use it in GitHub Desktop.
My preferred gitconfig setup
[user]
email = b-dur@b-dur.dk
name = Bardur Sigmundarson
[branch]
autosetuprebase = always
[core]
editor = vim
[push]
default = current
[rebase]
autoStash = true
autosquash = true
[alias]
pf = push --force-with-lease
pushf = push --force-with-lease
rebase-on = !git fetch -p && git rebase --autostash
update = pull --autostash
fixup = commit --fixup
logs = log --oneline
rebase-fix = rebase -i --autostash --autosquash
prune-branches = "!f() { git branch --merged | grep -v '*' | xargs git branch -d; }; f"
up = "!f() { git rebase-on $(git origin); git pf; }; f"
nb = "!f() { git fetch -p; git checkout -b \"$1\" $(git origin); }; f"
new = nb
origin = "!f() { git branch -rl '*/HEAD' | cut -d ' ' -f 5-; }; f"
[fetch]
prune = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment