Skip to content

Instantly share code, notes, and snippets.

@nurse
Created April 16, 2012 04:19
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 nurse/2396326 to your computer and use it in GitHub Desktop.
Save nurse/2396326 to your computer and use it in GitHub Desktop.
Naruse's .gitconfig
[core]
pager = less
editor = vim
[alias]
ci = commit -v
st = status
di = diff
co = checkout
br = branch
l = log --date=local
lp = log --date=local -p
ls = log --stat
cci = "!f(){ git di HEAD ChangeLog|ruby -e'$><<$<.read[/(^\\+(\t.*)?\\n)+/].gsub(/^\\+\t?/,%[]) rescue abort(%[no changelog message])'|git ci -F- -a; git show HEAD; }; f"
up = "!~/bin/git-up"
find-rev = "!sh -c 'git log -1 --grep=\"^git-svn-id: [^ ]*@${1#r} \" --format=%H' _"
show-rev = "!sh -c 'git log -1 --grep=\"^git-svn-id: [^ ]*@${1#r} \" -p' _"
#http://gcc.gnu.org/wiki/GitMirror
sr = svn rebase
sci = svn dcommit
# The current branch.
cbr = "!f(){ expr $( ( git symbolic-ref -q HEAD || cat $(git dir)/rebase-merge/head-name ) 2>/dev/null ) : 'refs/heads/\\(.*\\)'; }; f"
# The branch being tracked by the current branch.
track = "!f() { if p=$(git rev-parse --symbolic-full-name '@{u}' 2>/dev/null); then echo origin/${p##*/}; else git svn info|sed -n 's,^URL.*gcc/\\(branches/\\)\\?\\(.*\\),origin/\\2,p'; fi; }; f"
# Show all the local commits on this branch.
lg = "!git log -p `git track`.."
# Write all the local commits to ~/patch, filtering out modifications to ChangeLog files
lgp = "!git log -p `git track`.. | filterdiff -x '*/ChangeLog' | sed -e '/^diff.*ChangeLog/{N;d}' > ~/patch"
# Show all the local changes on this branch as one big diff.
df = "!git diff $(git merge-base $(git track) HEAD)"
dc = diff --cached
# Reorganize the local commits on this branch.
rb = "!git rebase -i `git track`"
rc = rebase --continue
rs = rebase --skip
# 'git rmerge mybranch' to reintegrate a temporary branch onto the top of the current branch
rmerge = "!f(){ cur=`git cbr`; git rebase $cur $1; git rebase $1 $cur; }; f"
[color]
diff = auto
status = auto
branch = auto
interactive = auto
[merge "merge-changelog"]
name = GNU-style ChangeLog merge driver
driver = /usr/local/bin/git-merge-changelog %O %A %B
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment