Created
August 31, 2011 18:18
-
-
Save THuRStoN/1184270 to your computer and use it in GitHub Desktop.
Bash w/ Git integration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Set prompt to abbr. of current directory & (git branch). | |
| #PROMPT_COMMAND='CurDir=`pwd|sed -e "s!$HOME!~!"|sed -E "s!([^/])[^/]+/!\1/!g"`' | |
| #1st PS1='\e[1;34m\u\e[1;35m@\e[0;39m\h\e[0;39m $CurDir$(__git_ps1) \e[1;35m>\e[0;39m ' | |
| #2nd export PS1='\e[1;34m\u\e[1;35m@\e[0;39m\h\e[0;39m \[\033[1;33m\]\w\[\033[0m\]$(__git_ps1) \e[1;35m>\e[0;39m ' | |
| function parse_git_dirty { | |
| git diff --quiet HEAD &>/dev/null | |
| [[ $? == 1 ]] && echo "*" | |
| } | |
| function parse_git_branch { | |
| local branch=$(__git_ps1 "%s") | |
| [[ $branch ]] && echo "[$branch$(parse_git_dirty)]" | |
| } | |
| export PS1='\e[1;34m\u\e[1;35m@\e[0;39m\h\e[0;39m \[\033[1;33m\]\w\[\033[0m\]$(parse_git_branch) \e[1;35m>\e[0;39m ' | |
| # Command Aliases | |
| alias cp="cp -i" | |
| alias mv="mv -i" | |
| alias ln="ln -i" | |
| alias ll="ls -Ali" | |
| export PATH=/System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/Home/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin | |
| export GIT_SSL_NO_VERIFY=true | |
| source ~/.git-completion.bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment