Saturday, July 19, 2014

Setting up a git-friendly shell-environment on Mac OS Mavericks

Shell colors (ls)

edit your ~/.bash_profile file:
export CLICOLOR=1
export LSCOLORS=ExGxBxDxCxEgEdxbxgxcxd

git colors

edit your ~/.gitconfig file:
[color]
    branch = auto
    diff = auto
    status = 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
git autocompletion and status in bash-prompt

edit your ~/.bash_profile file:
source /Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-completion.bash
source /Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-prompt.sh
GIT_PS1_SHOWDIRTYSTATE=true
export PS1='\u@\h:\w$(__git_ps1)$ '

No comments:

Post a Comment