I had git previously installed using ubuntu apt-get installed. Recently uninstalled it and installed git from source to get version 1.8.4 .
However now whenever I open a new termial on Ubuntu, I get the following error:
-bash: /usr/lib/git-core/git-sh-prompt: No such file or directory
I have tried to search various bash start files like .bashrc , .bash_profile or .profile, but can't find any reference to any git based setup.
How can I remove this error. I do not have /usr/lib/git_core folder, but do have /usr/libexec/git-core folder.
Purging the git packages solves the problem:
sudo apt-get purge git
Gives:
$ sudo apt-get purge git
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED
git*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]?
(Reading database ... 103069 files and directories currently installed.)
Removing git ...
Purging configuration files for git ...
There is a file git*
in the directory /etc/bash_completion.d which tried to access /usr/lib/git-core/git-sh-prompt
, maybe from the previous installation.
Try to delete git*
and then reinstall again from source
rm -rf /etc/bash_completion.d/git
Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=726669
Ubuntu: https://bugs.launchpad.net/ubuntu/+source/git/+bug/1196510
Mint: forums.linuxmint.com/viewtopic.php?f=47&t=135218
You should be able to comment ". /usr/lib/git-core/git-sh-prompt" out of /etc/bash_completion.d/git-prompt or do what Debian Jessie has done and check whether the file exists or not.
The following the is /etc/bash_completion.d/git-prompt in its entirety from Jessie:
# In git versions < 1.7.12, this shell library was part of the
# git completion script.
#
# Some users rely on the __git_ps1 function becoming available
# when bash-completion is loaded. Continue to load this library
# at bash-completion startup for now, to ease the transition to a
# world order where the prompt function is requested separately.
#
if [[ -e /usr/lib/git-core/git-sh-prompt ]]; then
. /usr/lib/git-core/git-sh-prompt
fi
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With