Skip to content

Instantly share code, notes, and snippets.

@renefritze
Created November 6, 2012 13:09
Show Gist options
  • Save renefritze/4024634 to your computer and use it in GitHub Desktop.
Save renefritze/4024634 to your computer and use it in GitHub Desktop.
GIT config
[merge]
#tool = gvimdiff
tool = meld
prompt = false
[user]
name = NAME
email = EMAIL
signingkey = XXX
[github]
user = USER
token = XXX
[alias]
d = diff
l = log
co = checkout
cob = checkout -b
pom = push origin master
mt = mergetool
dt = difftool
m = merge
ci = commit
ch = cherry-pick
st = status
f = fetch
fa = fetch --all
po = push origin
p = pull
pr = pull --rebase
r = rebase
fixup = !sh -c 'git commit -m \"fixup! $(git log -1 --format='\\''%s'\\'' $@)\"' -
squash = !sh -c 'git commit -m \"squash! $(git log -1 --format='\\''%s'\\'' $@)\"' -
ri = rebase --interactive --autosquash
rc = rebase --continue
rs = rebase --skip
ra = rebase --abort
amend = commit --amend
last = cat-file commit HEAD
cat = -p cat-file -p
# example: git subdo pull
subdo = submodule foreach git
# usage example: git w -n5
w = whatchanged
# add all changed (but not new) files to stage (index):
au = add -u
# show conflicting merge in gitk:
gitkconflict = !gitk --left-right HEAD...MERGE_HEAD
# prune all tracking local branches that have been removed from remote:
prune-all = !git remote | xargs -n 1 git remote prune
# show full history in gitk (including "deleted" branches and stashes)
history-all = !gitk --all $( git fsck | awk '/dangling commit/ {print $3}' )
# show list of contributors in descending order by number of commits
rank = shortlog -sn --no-merges
# given a string for an author, try to figure out full name and email:
whois = "!sh -c 'git log -i -1 --pretty=\"format:%an <%ae>\n\" --author=\"$1\"' -"
# given any git object, try to show it briefly
whatis = show -s --pretty='tformat:%h (%s, %ad)' --date=short
# Search for a given string in all patches and print commit messages
# example: search for any commit that adds or removes string "foobar"
# git searchcommits foobar
# example: search commits for string "foobar" in directory src/lib
# git searchcommits foobar src/lib
# example: search commits for "foobar", print full diff of commit with 1 line context
# git searchcommits foobar --pickaxe-all -U1 src/lib
searchcommits = "!f() { query=\"$1\"; shift; git log -S\"$query\" \"$@\"; }; f \"$@\""
[difftool]
prompt = false
tool = vimdiff
[diff]
renames = copies
mnemonicprefix = true
[core]
excludesfile = ${HOME}/.gitignore
pager = vimpager
color = auto
[color]
branch = auto
diff = no
interactive = auto
status = auto
[advice]
statusHints = false
[branch]
autosetupmerge = true
[push]
default = tracking
[rerere]
enabled = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment