Skip to content

Instantly share code, notes, and snippets.

@igal
Created August 28, 2012 06:51
Show Gist options
  • Save igal/3495650 to your computer and use it in GitHub Desktop.
Save igal/3495650 to your computer and use it in GitHub Desktop.
Git configuration
#---[ Includes ]--------------------------------------------------------
[include]
# Load private information from a separate file, e.g. name, email, global
# ignores, tokens, etc.
path = ~/.gitconfig.local
#---[ Settings ]--------------------------------------------------------
[core]
# Detect and warn about whitespace
whitespace = trailing-space,space-before-tab
[apply]
# Fix whitespace changes when patching
whitespace = fix
[color]
# I want purdy colors.
ui = true
[rerere]
# Remember how I resolve conflicts and reuse them
enabled = 1
[branch]
# Always do rebase when pulling changes
autosetuprebase = always
[push]
# MODES:
# "tracking" -- push current branch to whatever it is tracking
# "current" -- push current branch
# "matching" -- push all matching branches (default)
default = tracking
[alias]
# [a]dd [p]atch
ap = add -p
# [b]ranch
b = branch
# [b]ranch [a]ll (show all branches)
ba = branch -a
# prune all stale remote branches
branch-prune
# [c]omm[i]t
ci = commit -v
# [c]ommit with [m]essage
cm = commit -m
# [c]heck[o]ut
co = checkout
# [d]iff
d = diff --patience
# [d]iff [c]ached
dc = diff --patience --cached
# [d]iff [w]ords
dw = diff --patience --color-words
# [f]ormat [p]atch
fp = format-patch
# git [g]ui
g = !git gui &
# show [gr]aph (verbose)
gr = log --graph
# show [g]raph [o]neline (compact)
go = log --graph --pretty=oneline --abbrev-commit
# git[k]
k = !gitk &
# git[k] on [a]ll branches
ka = !gitk --all &
# [l]ist [c]ommits from latest fetch
lc = log ORIG_HEAD.. --stat --no-merges
# [l]og [p]atch
lp = log --patch-with-stat
# [m]erge [n]o [f]ast-forwards (create a merge even if a fast-forward is possible)
mnff = merge --no-ff
# [m]erge[t]ool
mt = mergetool
# format [p]atch for a single commit
p = format-patch -1
# [serve] git repository with daemon
serve = !git daemon --reuseaddr --verbose --base-path=. --export-all ./.git
# [s]tatus
s = status
st = status
# [sw]itch to previous branch
sw = checkout @{-1}
# [s]hut [t]he [f] [u]p (show status but witout untracked files)
stfu = status --untracked=no
# [up]date repository by saving uncommited changes to stash, pulling new ones and popping stashed changes
up = !git stash save && git pull --rebase && git stash pop && echo 'Success!'
update = !git stash save && git pull --rebase && git stash pop && echo 'Success!'
# [abort] rebase
abort = rebase --abort
# [continue] rebase
continue = rebase --continue
# [skip] rebase
skip = rebase --skip
# [amend] commit
amend = commit --amend
# [put] changes to branch on origin with the same name as this one, e.g. "pu"
put = push origin HEAD
# [get] changes from branch on origin with the same name as this one, e.g. "pu"
get = pull origin HEAD
fall = fetch --all
# show local [unmerged] branches
unmerged = branch --no-merge
# show [all] [unmerged] branches, including local and remote
unmergedall = branch -a --no-merge
# [q]git
q = !qgit --all &
# start git [ui] programs
ui = !git ka && git g &
# [review] all changes starting at FIRST ARGUMENT to the head of this branch
review = !sh -c 'git log --patch --decorate --reverse --find-renames --find-copies-harder --patience ${0}..HEAD'
#---[ GUI diff and merge tools ]----------------------------------------
# `git-meld` for tree diffs provided by https://github.com/wmanley/git-meld
[diff]
renames = copies
tool = diffuse
[merge]
tool = diffuse
conflictstyle = diff3
log = true
[mergetool]
prompt = false
keepBackup = false
keepTemporaries = false
#---[ fin ]-------------------------------------------------------------
# vim:noexpandtab:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment