Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 179 lines (136 sloc) 5.934 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179
# enable color when possible
[color]
ui = auto

# Add some color for grep output.
[color "grep"]
filename = magenta
linenumber = green
match = bold red

# Bold the upstream branch name in `git branch -vv`
[color "branch"]
upstream = bold blue

# add some short cuts... most of them familiar to those of us coming from
# other VCSes.
[alias]
co = checkout
st = status -sb
up = !git remote update -p && git merge --ff --ff-only @{u}
ru = reset --hard @{u}

# A quick way to squash changes into the previous commit using
# the same log message
amend = commit --amend --no-edit

# A handy graph-based log view
lol = log --abbrev-commit --graph --decorate

# Fast-forward pull
ff = !sh -c 'git merge --ff --ff-only ${1:-@\\{u\\}}' -

# Fetch all branches
fa = fetch --all

# Fetch all tags
ft = fetch --tags

# Show the type of the object
type = cat-file -t

# Pretty print the object
dump = cat-file -p

# show difference between the HEAD and the index
staged = diff --cached

# show difference between working tree and the index
unstaged = diff

# show staged and unstaged changes (what would be committed with "git commit -a")
both = diff HEAD

# Show all files that are being ignored
ignored = ls-files --others -i --exclude-standard

# Have info show the remote urls
info = !git config --get-regex 'remote\\.[^.]+\\.(push)?url' | sort | xargs -n2 printf '%25s %s\n'

# diffstat output, without the pager
diffstat = !git --no-pager diff --stat -r

# Prune all stale remote branches from the local repository
prune-all = !git remote | xargs -n 1 git remote prune

# Provide ack-like output for git grep
ack = grep --break --heading -n

# Taken from man git-config... shows all new commits introduced
# since the last pull
new = !gitk --all --not ORIG_HEAD

# Handy alias to show all relevant tips. Using this like:
# git tips origin/pu ^origin/next | git oneline
#
# would show all branches in pu that are not in next.
# Thanks to Jon Seymour for posting this on the git list.
tips = "!_() { t=$(git rev-list --no-merges --max-count=1 \"$@\"); if test -n \"$t\"; then echo $t; _ \"$@\" ^$t; fi; }; _"
oneline = !xargs -L1 git log --decorate --max-count=1 --oneline

# Lists all the defined aliases
# Taken from https://git.wiki.kernel.org/index.php/Aliases#alias
aliases = !git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /'

# Taken from https://git.wiki.kernel.org/index.php/Aliases#Finding_the_right_commit

# Getting pretty logs.
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative

# If you use shortened hashes, sometimes you may encounter a
# collision. The following alias prints out all commits whose
# hash start with given string.
abbr = "!sh -c 'git rev-list --all | grep ^$1 | while read commit; do git --no-pager log -n1 --pretty=format:\"%H %ci %an %s%n\" $commit; done' -"

# Helpful aliases for fixing up and squashing commits from Jacob
# Helwig's blog post:
# <http://technosorcery.net/blog/2012/08/05/updated-git-rebase-interactive-autosquash-commit-preparation/>
# Needs Git 1.7.4 or greater.
fixup = !sh -c 'git commit --fixup=$1' -
squash = !sh -c 'git commit --squash=$1' -
ri = rebase --interactive --autosquash

# Helper to set upstream
set-upstream = "!sh -c 'git remote add upstream $1 && git fetch upstream && git branch --set-upstream-to=${2:-upstream/master} && git config --add remote.upstream.pushurl $(git config remote.origin.url)' -"

# This is useful after a set-upstream, if you have push priviliges on
# the upstream repo.
set-upstream-push = "!sh -c 'git config --add remote.upstream.pushurl $(git config remote.upstream.url)' -"

# Helper to set origin (for instance, when I clone a repo, and then
# decide to fork it).
set-origin = !sh -c 'git remote rename origin upstream && git remote add origin $1 && git fetch origin && git config branch.master.pushremote origin' -

# Compute interdiff between two commits...
interdiff = !sh -c 'git -c color.ui=off show "$1" > .git/commit1 && git -c color.ui=off show "$2" > .git/commit2 && interdiff .git/commit[12]' -

# Push and bring my remotes up-to-date.
p = !sh -c 'git push "$@" && git ffwd' -

[core]
# make central area for git ignores. copy gitignores and change this to
# excludesfile = ~/.gitignores
# if you need to customize it
excludesfile = ~/projects/etc/gitconfig/gitignores

whitespace = cr-at-eol,space-before-tab,trailing-space,tabwidth=8

# This enables parallel index operations and can help when running
# git on network drives or Windows.
preloadindex = true

[diff]
# Does rename detection during diff operation
renames = true
renamelimit = 3000

[diff "cpp"]
# Use a funcname that copes better with return type being on a
# separate line than the function name. This will match anything
# that looks like a function in column 1. It seems like a good
# trade-off though.
xfuncname = "!^[ \t]*[A-Za-z_][A-Za-z_0-9]*:.*$\n"\
"^(([A-Za-z_][A-Za-z_0-9]*([ \t*]+)?[A-Za-z_][A-Za-z_0-9]*([ \t]*::[ \t]*[^[:space:]]+)?){1,}[ \t]*\\([^;]*)$\n"\
"^((typedef|struct|class|enum)[^;]*)$"

[push]
default = current

[rerere]
enabled = 1

[merge]
ff = false

[sendemail]
# Don't thread all the patches into a single topic. Make each patch its
# own topic.
chainreplyto = false

[tig]
show-date = relative
show-rev-graph = yes
show-refs = yes
line-graphics = ascii

[transfer]
fsckObjects = true

[pager]
diff = diff-highlight | less
show = diff-highlight | less
log = diff-highlight | less
interdiff = (type cdiff >& /dev/null && cdiff || cat -) | diff-highlight | less

# You might need the below, if you regularly work against HTTPS servers that
# don't validate because of missing CA certs. It's always better to fix that
# problem, but let's face it, it doesn't always happen.
#[http]
# sslVerify = false
Something went wrong with that request. Please try again.