Skip to content

Instantly share code, notes, and snippets.

@jaymecd
Last active December 25, 2015 02:09
Show Gist options
  • Save jaymecd/6900705 to your computer and use it in GitHub Desktop.
Save jaymecd/6900705 to your computer and use it in GitHub Desktop.
GIT setup
[core]
editor = vi
pager = less
autocrlf = input
ignorecase = false
whitespace = trailing-space,space-before-tab,indent-with-non-tab
excludesfile = /etc/gitignore
[color]
ui = true
[alias]
up = !(git add . && git stash && git pull --rebase >&2) | grep -v \"No local changes to save\" && git stash pop
in = "!git remote update -p; git log ..@{u}"
out = log @{u}..
addremove = !git add . && git ls-files --deleted | xargs --no-run-if-empty git rm
unstage = reset HEAD --
backup = !file=../`git describe`.tar && echo \"Creating `readlink -f $file`\" && tar cf $file .
bname = !git symbolic-ref -q HEAD 2>/dev/null | sed -e \"s|^refs/heads/||\"
tname = !git describe --abbrev=0 --exact-match 2>/dev/null
st = status -s
ci = commit
co = checkout
br = branch
bra = branch -a
chp = cherry-pick
pr = pull --rebase
bl = blame -b -w
cia = commit --amend
addu = !git add $(git ls-files -o --exclude-standard)
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
lg = log --all --graph --abbrev-commit --date=relative --topo-order --pretty=format:\"%C(cyan)[%h]%C(reset) %s%C(red)%d%C(reset) %C(yellow)[%cr]%C(reset) %C(cyan)<%an>%C(reset)\"
who = !git shortlog -s -- | sort -r
cdiff = !git diff | colordiff | more -r
[push]
default = current
# allow gitkeep
!*.gitkeep
# OS temp files
Thumbs.db
.DS_Store
*.swp
*.out
*.bak
*~
# IDE files
/nbproject/
/.vagrant/
/.settings/
/.project
/.buildpath
/.idea/

Global git setup

$ curl -sSL https://gist.github.com/jaymecd/6900705/raw/gitconfig | sudo tee /etc/gitconfig

$ curl -sSL https://gist.github.com/jaymecd/6900705/raw/gitignore | sudo tee /etc/gitignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment