Advertisement
slovacus

agregar el nombre de branch en directorio

Mar 20th, 2012
363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.37 KB | None | 0 0
  1. #Code for bash, goes into ~/.bashrc:
  2.  
  3. function parse_git_dirty {
  4.   [[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
  5. }
  6. function parse_git_branch {
  7.   git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
  8. }
  9. export PS1='\u@\h \[\033[1;33m\]\w\[\033[0m\]$(parse_git_branch)$ '
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement