Originally Posted by yogesh605
when i type su command following error comes error is:"bash: __git_ps1: command not found". what is problem?
'__git_ps1' is (on my system at least) a shell function which is used by bash auto completion - on my Ubuntu system it appears to be defined in '/etc/bash_completion.d/git'.
When does this error pop up. If you are getting it as soon as you switch user and every time you enter a command (i.e. a new prompt is shown) it will be because your PS1 variable is telling the shell '__git_ps1' to set the value of the prompt.
I will hazard a guess (and it is very hazardous, given the sparsity of the information given) and say:
Whoever made changed the prompt (PS1) variable, did so in the global bashrc or profile, however bashcompletion isn't enable for all users and so the function isn't created when they log on. Simple way to fix it is to change the PS1 variable once you have switched users :
export PS1="\u@\h:\w$ "