Skip to content

Instantly share code, notes, and snippets.

@adswebwork
Created October 23, 2014 18:17
Show Gist options
  • Save adswebwork/1e5ccb2549b04e721c06 to your computer and use it in GitHub Desktop.
Save adswebwork/1e5ccb2549b04e721c06 to your computer and use it in GitHub Desktop.
Configuration of git commands
[user]
name = YOURNAME
email = [email protected]
[color "branch"]
current = red
local = yellow
remote = green
[color "diff"]
meta = yellow
frag = magenta bold
old = red bold
new = green bold
whitespace = white reverse
[color "status"]
added = yellow
changed = green
untracked = cyan
[core]
whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol
autocrlf = true
editor = vim
[push]
default=tracking
[alias]
#File manipulation
ci = commit
l = pull --rebase
rc = rebase --continue
rs = rebase --skip
ra = rebase --abort
p = push
r = remote -v
co = checkout
switch = checkout
sync = !git remote prune origin && git fetch
br = branch -ravv
mg = merge origin/master
tool = mergetool
flush = reset --hard origin/master
#Status
s = status
i = init
#Git ignore
h = "!git ls-files -v | grep '^h'| cut -c 3-" #used to list all hidden files
hide = update-index --assume-unchanged
unhide = update-index --no-assume-unchanged ^M
#Locate text
f = "!git ls-files | grep -i"
grep = grep -Ii
gr = grep -Ii
#Git logs
filelog = log -u
fl = log -u
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cgreen\\ [%cn]" --decorate
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cgreen\\ [%cn]" --decorate --numstat
ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cgreen\\ [%cn]" --decorate --date=relative
le = log --oneline --decorate
dl = "!git ll -1"
dlc = diff --cached HEAD^
#List aliases
f= "config --get-regexp alias"
a= "add ."
#Stashes
stashes = stash list
[branch "master"]
remote = origin
merge = refs/heads/master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment