shell - -bash: __git_ps1: command not found -


i tried install ruby 2.0. command line urped , looks following:

-bash: __git_ps1: command not found [11:58:28][whatever@whatever ~]$  

i have not clue how rid of __git_ps1 command not found error. i've searched .bash_profile , .bashrc see if it's trying set variable or , not seeing anything. place can find git_ps1 mentioned in ~/.dotfiles/.bash_prompt. replace content of file completely, logout , log in , fixes nothing.

i saw this, i'm pretty new command line confused myself.

any ideas?

bash has whole slew of ways of automatically setting prompt give nice information. set prompt setting ps1 environment variable. example, if set ps1="$ " prompt this:

$  

not informative. can tell command line prompting me.

however, if set ps1=\u@\h: \w$, prompt this:

david@vegibank:/usr/bin$  

that tells me how i'm logged in (the \u), machine i'm onto (\h), , directory i'm in (the \w). if use git, nice if git branch i'm in part of prompt.

this going on .profile, .bashrc file, .bash_login or .bash_profile script. or, system admin did in /etc/profile.

there couple things can do. either:

  • download missing __git_ps1 , make sure it's in $path environment variable (which set combination of various initialization files mentioned above)
  • change ps1 environment variable in whatever initialization file being executed (i believe .bash_profile.

just add last line:

ps1="\u@\h:\w\n$ " 

the added \n prints dollar sign prompt on line below this:

david@vegibank:/usr/bin $  

i because prompt can rather long , editing command line gets tricky when prompt longer 30 50 characters. otherwise, it's pretty standard prompt users use. can see more setting bash prompts in man pages. (search word prompting on page).

if find bit confusing, glad you're not using kornshell. use kornshell , same prompt ps1=\u@\h:\w\n$ does, set prompt as:

export ps1='$(print -n "`logname`@`hostname`:";if [[ "${pwd#$home}" != "$pwd" ]] then; print -n "~${pwd#$home}"; else; print -n "$pwd";fi;print "\n$ ")' 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

android - Keyboard hides my half of edit-text and button below it even in scroll view -