#+TITLE: Git Configuration #+AUTHOR: Mitch Tishmack #+STARTUP: hidestars #+STARTUP: odd #+BABEL: :cache yes #+PROPERTY: header-args :cache yes :padline no :comments no General git configuration split out into sections mostly. * ~/.gitconfig :PROPERTIES: :header-args: :tangle tmp/.gitconfig :comments no :padline no :cache yes :mkdirp yes :END: ** pager #+BEGIN_SRC conf :tangle (when (eq git-p t) "tmp/.gitconfig") [pager] color = true #+END_SRC ** color #+BEGIN_SRC conf :tangle (when (eq git-p t) "tmp/.gitconfig") [color] status = auto diff = auto branch = auto [color "status"] added = green changed = blue untracked = red [color "branch"] current = green local = blue remote = red [color "diff"] meta = blue bold frag = black reverse old = red reverse new = green reverse #+END_SRC ** alias #+BEGIN_SRC conf :tangle (when (eq git-p t) "tmp/.gitconfig") [alias] begin = !git init && git commit --allow-empty -m 'Initial empty commit' up = !git pull --rebase && git push wsd = diff --color-words --ignore-space-at-eol --ignore-space-change --ignore-all-space wd = diff --color-words fa = fetch --all ci = commit ciu = commit --all co = checkout ds = diff --stat ba = branch --all b = branch st = status --short --branch s = status --short --branch --untracked-files=no unstage = reset HEAD tlog = log --graph --color=always --abbrev-commit --date=relative --pretty=oneline hist = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative slog = log --oneline --decorate fixup = commit --fixup squash = commit --squash ri = rebase --interactive --autosquash ra = rebase --abort effit = reset --hard cp = log --no-merges --cherry --graph --oneline # What commits differ between branches, note, equivalent commits are omitted. # Use this with three dot operator aka master...origin/master cpd = log --no-merges --left-right --graph --cherry-pick --oneline # Same as ^ only equivalent commits are listed with a = sign. cmd = log --no-merges --left-right --graph --cherry-mark --oneline # git update with submodule update sup = git pull --rebase && git submodule update --init --recursive # git clone with submodules sc = !git clone --recursive $1 # what files are getting updated a lot churn = !git log --all -M -C --name-only --format='format:' "$@" | sort | grep -v '^$' | uniq -c | sort | awk 'BEGIN {print "count,file"} {print $1 "," $2}' # help the gc a bit and get a bit more space back for a local clone trim = !git reflog expire --expire=now --all && git gc --prune=now aliases = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\ \t => \\2/' | sort #+END_SRC ** github #+BEGIN_SRC conf :tangle (when (eq git-p t) "tmp/.gitconfig") [github] user = mitchty #+END_SRC ** credential #+BEGIN_SRC conf :tangle (when (eq git-p t) "tmp/.gitconfig") [credential] helper = netrc -v -f ~/.netrc.gpg -f ~/.netrc #+END_SRC ** advice #+BEGIN_SRC conf :tangle (when (eq git-p t) "tmp/.gitconfig") [advice] statushints = false #+END_SRC ** gui #+BEGIN_SRC conf :tangle (tangle/file 'git-p ".gitconfig") [gui] fontui = -family Monaco -size 8 -weight normal -slant roman -underline 0 -overstrike 0 fontdiff = -family Monaco -size 8 -weight normal -slant roman -underline 0 -overstrike 0 #+END_SRC ** http #+BEGIN_SRC conf :tangle (when (eq git-p t) "tmp/.gitconfig") [http] postBuffer = 209715200 #+END_SRC ** push #+BEGIN_SRC conf :tangle (when (eq git-p t) "tmp/.gitconfig") [push] default = simple #+END_SRC ** url rewrites #+BEGIN_SRC conf :tangle (tangle/file 'git-p ".gitconfig") [url "https://github.com/"] insteadOf = git://github.com/ #+END_SRC ** username/email #+BEGIN_SRC conf :tangle (tangle/file 'git-p ".gitconfig") [user] name = Mitch Tishmack email = mitch.tishmack@gmail.com #+END_SRC * ~/.gitignore :PROPERTIES: :header-args: :tangle tmp/.gitignore :comments no :padline no :cache yes :mkdirp yes :END: Common crap/build artifacts that git should always ignore. #+BEGIN_SRC conf :tangle no .*~ *~ .\#* \#* \#*\# .\#*\# .DS_Store *.pyc *.rbc *.elc *.swp *.[oa] *.hi #+END_SRC