Skip to content

Instantly share code, notes, and snippets.

@lorenasg1
Last active November 10, 2025 22:06
Show Gist options
  • Select an option

  • Save lorenasg1/05a1984f3afcb964b4e37f1386c80dd6 to your computer and use it in GitHub Desktop.

Select an option

Save lorenasg1/05a1984f3afcb964b4e37f1386c80dd6 to your computer and use it in GitHub Desktop.
[core]
editor = code
excludesfile = ~/.gitignore_global
pager = less -R
logAllRefUpdates = true
[alias]
ci = commit
co = checkout
cm = !git add -A && git commit -m
cb = checkout -b
# po = !git push -u origin $(git describe --contains --all HEAD)
po = !git push -u origin $(git rev-parse --abbrev-ref HEAD) --progress
# st = status -sb
st = status
sf = show --name-only
ec = config --global -e
# lg = log --pretty=format:'%Cred%h%Creset %C(bold)%cr%Creset %Cgreen<%an>%Creset %s' --max-count=30
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --branches
incoming = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' ..@{u})
outgoing = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' @{u}..)
unstage = reset HEAD --
undo = checkout --
rollback = reset --soft HEAD~1
amend = commit -a --amend
save = !git add -A && git commit -m 'SAVEPOINT'
undo = reset HEAD~1 --mixed
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
wip = commit -am "WIP"
wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard
default = !git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'
bclean = "!f() { DEFAULT=$(git default); git branch --merged ${1-$DEFAULT} | grep -v " ${1-$DEFAULT}$" | xargs git branch -d; }; f"
bdone = "!f() { DEFAULT=$(git default); git checkout ${1-$DEFAULT} && git up && git bclean ${1-$DEFAULT}; }; f"
open = "!f(){ URL=$(git config remote.origin.url); open ${URL%.git}; }; f"
browse = !git open
migrate = "!f(){ DEFAULT=$(git default); CURRENT=$(git symbolic-ref --short HEAD); git checkout -b $1 && git branch --force $CURRENT ${3-$CURRENT@{u}} && git rebase --onto ${2-$DEFAULT} $CURRENT; }; f"
[pull]
rebase = true
[rerere]
enabled = true
autoupdate = true
[column]
ui = auto
[branch]
sort = -committerdate
[tag]
sort = version:refname
[init]
defaultBranch = main
[diff]
algorithm = histogram
colorMoved = plain
mnemonicPrefix = true
renames = true
[push]
autoSetupRemote = true
followTags = true
[fetch]
prune = true
pruneTags = true
all = true
[help]
autocorrect = prompt
[commit]
verbose = true
[rebase]
autoSquash = true
autoStash = true
updateRefs = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment