So I went through the environment setup (on Linux), and things seemed to be running smoothly. Then I opened up a new Terminal yesterday, and the following lines popped up before seeing a red ~$:
__git_complete: command not found
__git_ps1: command not found
Furthermore, every time I press enter, the second line (__git_ps1: command not found) keeps repeating itself.
When I open ~/.bashrc, I see the following:
look for commands in these places
make vim the default text editor
shortened prompt that includes git branch info
export PS1="$RED\w$WHITE$(__git_ps1)$RED$$RESET "
eval “$(rbenv init -)”
initialize node version manager
[ -s “$NVM_DIR/nvm.sh” ] && source “$NVM_DIR/nvm.sh”
[[ -f “$HOME/.aliases” ]] && source “$HOME/.aliases”
load any local configuration
[[ -f “$HOME/.bashrc.local” ]] && source “$HOME/.bashrc.local”
I see the line export PS1="$RED\w$WHITE$(__git_ps1)$RED$$RESET ", but I’m not sure if that was a result of installing the dotfiles, or if there are any further changes I need to make to the bash profile in order to avoid these constant error messages.
Looks like it can’t source the _git__sp1, may be the load extensitions can’t find _git__sp1.
Have you tried to look for .git-completion.bash and .git-prompt.sh to see where these 2 files are located?
Once you know the path, change the path to these 2 files in your .bashrc
Alright, good luck and let me know how things go for you
Thanks for your response. I have found the git completion file and sourced that, so now it only displays the _git__ps1 command not found error. I have been googling to try to find the location of the git prompt file with no luck. Do you happen to know where this file tends to be located in Linux?
Thanks again for your help!
Try look into the folder “git-core”, and source to it.
If you can’t find it, or get the same error after,
you can just reinstall git-core and bash-completion and configure it again, and you should be fine
run "sudo apt-get install git-core bash-completion"
run “bash” to restart your bash
and configure git again
Same error again, then look for git-completion and git prompt again since you have already install git-core and bash-completion.
Good luck and let me know after
I have managed to find the git-core folder, as well as source the git-prompt file. It was quite a lengthy learning experience regarding the Home folder vs. the Root folder. Thanks for your help, Thai!
For reference, anyone else using Ubuntu 16.04: the two paths I sourced when editing with the command “gedit .bashrc”:
Great! You’re welcome! I’m glad you got it working.