Skip to content

Instantly share code, notes, and snippets.

@rudifa
Created September 6, 2020 19:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rudifa/d36c0d52b07b33b2fcaf4852520b4dd0 to your computer and use it in GitHub Desktop.
Save rudifa/d36c0d52b07b33b2fcaf4852520b4dd0 to your computer and use it in GitHub Desktop.
dot-gitconfig
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[user]
name = ***
email = ***
[alias]
aliases = config --get-regexp alias
br = branch
brb = "!f() { sha=`git rev-parse --short HEAD`; echo ${sha}; git branch -f ${sha}_BAK; git rebase ${1}; }; f"
brbi = "!f() { sha=`git rev-parse --short HEAD`; echo ${sha}; git branch -f ${sha}_BAK; git rebase -i ${1}; }; f"
bsq = "!f(){ sha=`git rev-parse --short HEAD`; echo ${sha}; git branch -f ${sha}_BAK; git reset --soft HEAD~${1} && git commit --edit -m\"$(git log --format=%s --reverse HEAD..HEAD@{1})\"; };f"
bsqt = "!f(){ sha=`git rev-parse --short HEAD`; echo ${sha}; git branch -f ${sha}_BAK; git reset --soft ${1} && git commit --edit -m\"$(git log --format=%s --reverse HEAD..HEAD@{1})\"; };f"
caam = commit -a --amend --no-edit
cam = commit -am # works for tracked files only
ci = commit
co = checkout
cp = cherry-pick
diff1 = log -u -1 HEAD
example = "!f() { echo Your arg was ${1}.; }; f;"
#ignore = "!f() { cp ~/.gitignore .; }; f;"
ignore = "!f() { file="~/.gitignore_${1}"; if [ ! -f "${file}" ]; then file="~/.gitignore"; fi; cp "${file}" ./.gitignore; }; f" ### OK
lg = log --oneline
lgg = log --graph --pretty=format:"%C(yellow)%h%Creset%C(bold)%d%Creset%C(cyan)(%ci)%Creset%C(green)(%cn)%Creset%s"
lg0 = lgg -10
lst = ls-tree -r HEAD
rb = rebase
rbi = rebase -i
st = status
squash = "!f(){ git reset --soft HEAD~${1} && git commit --edit -m\"$(git log --format=%s --reverse HEAD..HEAD@{1})\"; };f"
tags = tag -l --format='%(tag) %(contents)'
# note: use \" inside "..."
[core]
# editor = nano
editor = "/Applications/Emacs.app/Contents/MacOS/Emacs-x86_64-10_14 -nw"
# editor = bbedit
[diff "odt"]
binary = true
textconv = odt2txt
[credential]
helper = osxkeychain
[cola]
spellcheck = false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment