Git checkout --patch but failed, could not find Git.pm at @INC

When I run git checkout -patch origin / master file.java I see:

Can't locate Git.pm in @INC (you may need to install the Git module) 
(@INC contains: 
/usr/share/perl/5.14.2 
/usr/local/perl/lib/site_perl/5.20.0/x86_64-linux 
/usr/local/perl/lib/site_perl/5.20.0 
/usr/local/perl/lib/5.20.0/x86_64-linux /usr/local/perl/lib/5.20.0 .) 
at /usr/lib/git-core/git-add--interactive line 7.
BEGIN failed--compilation aborted at /usr/lib/git-core/git-add--interactive line 7.

      

I am running it on Ubuntu 12.04.4 LTS. The git version is 1.7.9.5. Perl - perl5, version 20, subversion 0 (v5.20.0) for x86_64-linux.

+3


source to share


1 answer


/usr/share/perl5/Git.pm

(or similar, depending on the system) may not be available in PATH

.



Adding the file export PERL5LIB=/usr/share/perl5

to ~/.bashrc

should fix the problem.

+1


source







All Articles