Skip to content

Instantly share code, notes, and snippets.

@lucas-burdell
Last active June 3, 2022 14:08
Show Gist options
  • Save lucas-burdell/bcf93e01d0cba081ce6da8e44554023d to your computer and use it in GitHub Desktop.
Save lucas-burdell/bcf93e01d0cba081ce6da8e44554023d to your computer and use it in GitHub Desktop.
My Git Configurations
[core]
compression = 1
editor = vim
[diff "astextplain"]
textconv = astextplain
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[alias]
st = status
co = checkout
cob = checkout -b
cod = branch -D
cor = "!git co master && git cod "$1" && git up && git cob "$1" #"
cm = !git add -A && git commit -m
save = !git add -A && git commit -m '[WIP]'
amend = !git add -A && git commit --amend
undo = !git add -A && git reset --hard && git pull
up = !git fetch --prune && git merge
#'pretty print git log --graph'
lg1 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lg = ! git lg1
cleanup = "!git branch --merged master | grep -v 'master' | xargs git branch -D"
clearlocal = "!git remote update origin --prune && git branch -vv | grep ': gone]'| grep -v "\*" | awk '{ print $1; }' | xargs -r git branch -D"
#DANGER! DELETE local branch and origin
destroy = !g() {git branch -D $1 && git push origin $1 --delete;}; g
pset = !git push --set-upstream origin $(git branch --show-current)
squash = !git reset $(git merge-base master $(git rev-parse --abbrev-ref HEAD)) && git cm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment