linux - Problems for show branch in terminal -


i have problem shell script, it's in ~/.bashrc:

parse_git_branch() {     git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' } 

ps1="\[${debian_chroot:+($debian_chroot)}\033[1;34m\u\033[1;34m@\h\033[0;32m:\w\033[1;35m $(parse_git_branch) $ \033[0m\]"

i need show current branch, , it's doing fine, when need change directory take source ~ /. bashrc return work.

another problem when delete wrong typed erases information on line including vinicius@pontocom:~ (master) $

git comes shell scripts showing current branch, can use them adding

source '/usr/local/etc/bash_completion.d/git-prompt.sh' 

to bash config file on os x. if you're using debian, should able source same file, installation path might different.

you can enable git bash completions sourcing file well:

source '/usr/local/etc/bash_completion.d/git-completion.bash' 

Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -