Skip to content

Instantly share code, notes, and snippets.

@alejandrobernardis
Last active February 10, 2022 06:41
Show Gist options
  • Save alejandrobernardis/c5e159f53d0402b84e735e30d4ab8b4b to your computer and use it in GitHub Desktop.
Save alejandrobernardis/c5e159f53d0402b84e735e30d4ab8b4b to your computer and use it in GitHub Desktop.
GitConfig
[user]
email = alejandro.bernardis@gmail.com
name = Alejandro M. BERNARDIS
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[alias]
# edit
edit = config --global -e
# up
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
# save
savepoint = !git add -A && git commit -m 'TMP // Savepoint'
undopoint = reset HEAD~1 --mixed
changepoint = commit -a --amend
# push
pfa = !git add . && git commit -m 'UPD // First approach' && git push
pfx = !git add . && git commit -m 'UPD // Fixes' && git push
pfxm = !git add . && git commit -m 'UPD // +Fixes' && git push
pfe = !git add . && git commit -m 'UPD // Features' && git push
pfem = !git add . && git commit -m 'UPD // +Features' && git push
pdo = !git add . && git commit -m 'UPD // Documentation' && git push
pdom = !git add . && git commit -m 'UPD // +Documentation' && git push
pin = !git add . && git commit -m 'INI // Initial Commit' && git push -u origin master
# commits
cfa = !git add . && git commit -m 'UPD // First approach'
cfx = !git add . && git commit -m 'UPD // Fixes'
cfxm = !git add . && git commit -m 'UPD // +Fixes'
cfe = !git add . && git commit -m 'UPD // Features'
cfem = !git add . && git commit -m 'UPD // +Features'
cdo = !git add . && git commit -m 'UPD // Documentation'
cdom = !git add . && git commit -m 'UPD // +Documentation'
cin = !git add . && git commit -m 'INI // Initial Commit'
aliases = "!git config --get-regexp '^alias\\.' | cut -c 7- | sed 's/ / = /'"
# rollback
back = checkout -f .
# status
ss = status --short
ssb = status --short --branch
# ls
ls = ls-files
ls-ignored = ls-files --others --i --exclude-standard
# log
lg = log --graph
lo = log --oneline
lp = log --patch
lt = log --topo-order
lk = log --graph --topo-order --abbrev-commit --date=short --decorate --all --boundary --pretty=format:'%Cgreen%ad %Cred%h%Creset -%C(yellow)%d%Creset %s %Cblue[%cn]%Creset %Cblue%G?%Creset'
ll = log -n 10 --graph --topo-order --abbrev-commit --date=short --decorate --all --boundary --pretty=format:'%Cgreen%ad'
# logs
log-changes = log --oneline --reverse
log-fresh = log ORIG_HEAD.. --stat --no-merges
log-local = log --date=local
log-me = !git log --author $(git config user.email)
log-graph = log --graph --all --oneline --decorate
log-first-date = !"git log --date-order --date=iso --pretty=%ad --reverse | head -1"
log-day = log --since yesterday
log-standup = !git log --since yesterday --author $(git config user.email) --pretty=short
log-refs = log --all --graph --decorate --oneline --simplify-by-decoration --no-merges
log-timeline = log --format='%h %an %ar - %s'
log-local = log --oneline origin..HEAD
log-fetched = log --oneline HEAD..origin/master
# Reset & Undo
reset-commit = reset --soft HEAD~1
reset-commit-hard = reset --hard HEAD~1
reset-commit-clean = !git reset --hard HEAD~1 && git clean -fd
reset-to-pristine = !git reset --hard && git clean -ffdx
reset-to-upstream = !git reset --hard $(git upstream-name)
undo-commit = reset --soft HEAD~1
undo-commit-hard = reset --hard HEAD~1
undo-commit-clean = !git reset --hard HEAD~1 && git clean -fd
undo-to-pristine = !git reset --hard && git clean -ffdx
undo-to-upstream = !git reset --hard $(git upstream-name)
uncommit = reset --soft HEAD~1
unadd = reset HEAD
unstage = reset HEAD
discard = checkout --
cleanout = !git clean -df && git checkout -- .
expunge = !"f() { git filter-branch --force --index-filter \"git rm --cached --ignore-unmatch $1\" --prune-empty --tag-name-filter cat -- --all }; f"
empty = "!git commit -am\"[empty] Initial commit\" --allow-empty"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment