May 12, 2014

Add alias and color to git

edit your git config  /home/%youraccount%/.gitconfig as following

[alias]
   st = status
   ci = commit
   br = branch
   co = checkout
   df = diff
   lg = log -p
   lol = log --graph --decorate --pretty=oneline --abbrev-commit
   lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
   ls = ls-files
   meld = !/usr/local/bin/git-meld.pl
[merge]
   tool = meld
[mergetool]
   keepBackup = false
[merge "ours"]
   driver = true
[mct "review"]
   command = git meld
[color]
   ui = true
[color "diff"]
   whitespace = red reverse
[core]
   whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol
[color]
   ui = auto
[color "branch"]
   current = yellow reverse
   local = yellow
   remote = green
[color "diff"]
   meta = yellow bold
   frag = magenta bold
   old = red bold
   new = green bold
[color "status"]
   added = yellow
   changed = green
   untracked = cyan
[user]
   name = Fan Deng
   email = leondeng@gmail.com
[diff]
   tool = meld

No comments:

Post a Comment