Skip to content

Instantly share code, notes, and snippets.

@jredville
Created July 17, 2018 17:02
Show Gist options
  • Save jredville/c091c07990fbb26fb61da19f028c8a98 to your computer and use it in GitHub Desktop.
Save jredville/c091c07990fbb26fb61da19f028c8a98 to your computer and use it in GitHub Desktop.
[user]
name = Jim Deville
email = [email protected]
[merge]
keepBackup = false
[github]
user = jredville
[color]
ui = true
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red
new = green
[alias]
# add
a = add # add
chunkyadd = add --patch # stage commits chunk by chunk
# via http://blog.apiaxle.com/post/handy-git-tips-to-stop-you-getting-fired/
snapshot = !git stash save "snapshot: $(date)" && git stash apply "stash@{0}"
snapshots = !git stash list --grep snapshot
#via http://stackoverflow.com/questions/5188320/how-can-i-get-a-list-of-git-branches-ordered-by-most-recent-commit
recent-branches = !git for-each-ref --count=15 --sort=-committerdate refs/heads/ --format='%(refname:short)'
# branch
b = branch -v # branch (verbose)
# commit
c = commit -m # commit with message
ca = commit -am # commit all with message
ci = commit # commit
amend = commit --amend # ammend your last commit
ammend = commit --amend # ammend 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
last = diff HEAD^ # diff last committed change
# log
l = log --graph --date=short
changes = log --pretty=format:\"%h %cr %cn %Cgreen%s%Creset\" --name-status
short = log --pretty=format:\"%h %cr %cn %Cgreen%s%Creset\"
simple = log --pretty=format:\" * %s\"
shortnocolor = log --pretty=format:\"%h %cr %cn %s\"
tree = log --graph --oneline --decorate
ls = log --pretty='format:%C(yellow)%h %C(cyan)%ad%Cred%d %Creset%s%C(bold blue) [%cn]' --decorate --date=relative
ll = log --pretty='format:%C(yellow)%h %C(cyan)%ci%Cred%d %Creset%s%C(bold blue) [%cn]' --decorate --numstat
lg = log --graph --pretty=format:'%C(yellow)%h%Creset -%C(red)%d%Creset %s %C(cyan)(%cr) %C(bold blue)[%cn]%Creset' --abbrev-commit --date=relative
# pull
pl = pull # pull
# push
ps = 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
stat = status # status
# tag
t = tag -n # show tags with <n> lines of each tag message
# svn helpers
svnr = svn rebase
svnd = svn dcommit
svnl = svn log --oneline --show-commit
[format]
pretty = format:%C(blue)%ad%Creset %C(yellow)%h%C(green)%d%Creset %C(blue)%s %C(magenta) [%an]%Creset
[mergetool]
prompt = false
[merge]
summary = true
verbosity = 1
[apply]
whitespace = nowarn
[branch]
autosetupmerge = true
[push]
# 'git push' will push the current branch to its tracking branch
# the usual default is to push all branches
default = upstream
[core]
autocrlf = false
editor = vim
excludesfile = ~/.gitignore
[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
algorithm = patience
[rerere]
# Remember my merges
# http://gitfu.wordpress.com/2008/04/20/git-rerere-rereremember-what-you-did-last-time/
enabled = true
[filter "lfs"]
clean = git-lfs clean %f
smudge = git-lfs smudge %f
required = true
[credential]
helper = store
# OSX taken from: https://github.com/github/gitignore/blob/master/Global/OSX.gitignore
# ----------------------------------------------------------------------------------------------
.DS_Store
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
# Windows taken from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore
# ----------------------------------------------------------------------------------------------
# Windows image file caches
Thumbs.db
# Folder config file
Desktop.ini
# Tags taken from: https://github.com/github/gitignore/blob/master/Global/Tags.gitignore
# ----------------------------------------------------------------------------------------------
# Ignore tags created by etags, ctags, gtags (GNU global) and cscope
TAGS
!TAGS/
tags
!tags/
.tags
.tags1
gtags.files
GTAGS
GRTAGS
GPATH
cscope.files
cscope.out
cscope.in.out
cscope.po.out
# Vim taken from: https://github.com/github/gitignore/blob/master/Global/vim.gitignore
# ----------------------------------------------------------------------------------------------
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
*.un~
Session.vim
.netrwhist
*~
# SASS
# ----------------------------------------------------------------------------------------------
.sass-cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment