Skip to content

Instantly share code, notes, and snippets.

@jabooth
Created June 3, 2016 07:44
Show Gist options
  • Save jabooth/5098a71180be9ab71bd3f1b264a68d17 to your computer and use it in GitHub Desktop.
Save jabooth/5098a71180be9ab71bd3f1b264a68d17 to your computer and use it in GitHub Desktop.
.gitconfig
[user]
name = YOUR NAME
email = YOUREMAIL@PROVIDER.TLD
[credential]
helper = cache --timeout=3600
[core]
editor = vim
excludesfile = ~/.gitignore
[color]
ui = true
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[alias]
# add
a = add # add
chunkyadd = add --patch # stage commits chunk by chunk
# branch
b = branch -v # branch (verbose)
# commit
cm = commit -m # commit with message
cam = commit -am # commit all with message
c = commit # commit
amend = commit --amend # amend your last commit
# checkout
co = checkout # checkout
nb = checkout -b # create and switch to a new branch (mnemonic: "git new branch branchname...")
# cherry-pick
cp = cherry-pick -x # grab a change from a branch
# diff
d = diff # diff unstaged changes
dc = diff --cached # diff staged changes
dw = diff --words # diff where word groupings over the end of lines is a problem
last = diff HEAD^ # diff last committed change
# fetch
f = fetch
fo = fetch origin
fu = fetch upstream
# log
l = log --graph --date=short
lol = log --oneline --graph --decorate
changes = log --pretty=format:\"%h %cr %cn %Cgreen%s%Creset\" --name-status
short = log --pretty=format:\"%h %cr %cn %Cgreen%s%Creset\"
changelog = log --pretty=format:\" * %s\"
shortnocolor = log --pretty=format:\"%h %cr %cn %s\"
# push
p = push # push
# rebase
rc = rebase --continue # continue rebase
rs = rebase --skip # skip rebase
# remote
r = remote -v # show remotes (verbose)
# reset
unstage = reset HEAD # remove files from index (tracking)
uncommit = reset --soft HEAD^ # go back before last commit, with files in uncommitted state
filelog = log -u # show changes to a file
mt = mergetool # fire up the merge tool
# stash
ss = stash # stash changes
sl = stash list # list stashes
sa = stash apply # apply stash (restore changes)
sd = stash drop # drop stashes (destory changes)
# status
s = status # status
st = status # status
# tag
t = tag -n # show tags with <n> lines of each tag message
[push]
# 'git push' will push the current branch to its tracking branch
# the usual default is to push all branches
default = tracking
[advice]
statusHints = false
[diff]
# Git diff will use (i)ndex, (w)ork tree, (c)ommit and (o)bject
# instead of a/b/c/d as prefixes for patches
mnemonicprefix = true
submodule = log
[rerere]
# Remember my merges
# http://gitfu.wordpress.com/2008/04/20/git-rerere-rereremember-what-you-did-last-time/
enabled = true
[status]
submodulesummary = 1
[filter "lfs"]
clean = git lfs clean %f
smudge = git lfs smudge %f
required = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment