Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 

4.6 KiB

Git Configuration

General git configuration split out into sections mostly.

~/.gitconfig

pager

[pager]
  color = true

color

[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

alias

  [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
    cia = 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
    bn = rev-parse --abbrev-ref HEAD
    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
    defremote = !git branch -rvv | egrep 'HEAD' | awk '{print $1}' | sed -e 's|/HEAD||g'
    short = rev-parse --short
    find-merge = !sh -c "commit=$0 && branch=${1:-HEAD} && (git rev-list $commit..$branch --ancestry-path | cat -n; git rev-list $commit..$branch --first-parent | cat -n) | sort -k2 | uniq -f1 -d | sort -n | tail -1 | cut -f2"
    show-merge = !sh -c "merge=$(git find-merge $0 $1) && [ -n \"$merge\" ] && git show $merge"
    pbr = !git push --set-upstream $(git defremote) $(git bnam)

github

[github]
  user = mitchty

credential

[credential]
  helper = netrc -v -f ~/.netrc.gpg -f ~/.netrc

advice

[advice]
  statushints = false

gui

[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

http

[http]
  postBuffer = 209715200

push

[push]
  default = simple

url rewrites

[url "https://github.com/"]
  insteadOf = git://github.com/

username/email

[user]
  name = Mitch Tishmack
  email = mitch.tishmack@gmail.com

~/.gitignore

Common crap/build artifacts that git should always ignore.

.*~
*~
.\#*
\#*
\#*\#
.\#*\#
.DS_Store
*.pyc
*.rbc
*.elc
*.swp
*.[oa]
*.hi