Skip to content

Instantly share code, notes, and snippets.

@Meettya
Forked from anonymous/gist:4414249
Created December 30, 2012 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Meettya/4414251 to your computer and use it in GitHub Desktop.
Save Meettya/4414251 to your computer and use it in GitHub Desktop.
[user]
name =
email =
[core]
autocrlf = input
safecrlf = true
whitespace = fix, -indent-with-non-tab, trailing-space, cr-at-eol
pager = less -R
[alias]
# Base commands
ci = commit
br = branch
co = checkout
df = diff
lg = log -p
st = status --short
cia = commit --allow-empty-message -a
# Stash commands
sl = stash list
sa = stash apply
ss = stash save
# Show all prfiles
ls = !git rev-parse --abbrev-ref HEAD | xargs git ls-tree -r --full-tree --full-name --name-only
# Push into current remote branch
pc = !git rev-parse --abbrev-ref HEAD | xargs git push origin
# Show untracked files
stu = status --untracked-files=no
# Show history
history = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
# Show git commands
commands = help -a
# Get object type
type = cat-file -t
# Get file info
info = cat-file -p
# Show commit logs
logs = !git shortlog --summary | sort --reverse --numeric-sort
# Show conflicts
conflicts = !git ls-files --unmerged | cut -f2 | sort -u | xargs grep -El '<<<<<<<|=======|>>>>>>>'
# Show unmergd files
unmerged = !git ls-files --unmerged | cut -f2 | sort -u
# Show aliases
aliases = !git config -l | grep alias | cut -c 7-
# Find files
find = !git ls-files -r HEAD | grep -ii
# Remove files which have been deleted
remove = !git ls-files -z --deleted | xargs -0 git rm
# Ignore a file
ignore = !([ ! -e .gitignore ] && touch .gitignore) | echo $1 >> .gitignore
# Assume a file as unchanged
assume = !git update-index --assume-unchanged
# Unassume a file
unassume = !git update-index --no-assume-unchanged
# Show assumed files
assumed = !git ls-files -v | grep ^h | cut -c 3-
# Pull from remote repository
fork = !git config --get remote.origin.url | xargs git pull
go = !gitgo
[color]
diff = true
grep = true
status = true
ui = true
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = normal
frag = magenta bold
old = red bold
new = blue bold
whitespace = red reverse
[color "status"]
added = yellow
changed = green
untracked = cyan
[diff]
renames = copy
[log]
decorate = full
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment