qin hao
qin hao

Reputation: 43

git checkout --patch, but failed, Can't locate Git.pm in @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 run it on the Ubuntu 12.04.4 LTS. The version of git is 1.7.9.5. The perl is perl5, version 20, subversion 0 (v5.20.0) build for x86_64-linux.

Upvotes: 3

Views: 1960

Answers (1)

Anvesh Yalamarthy
Anvesh Yalamarthy

Reputation: 1693

/usr/share/perl5/Git.pm (or similar, depending on the system) might be missing in PATH.

Adding export PERL5LIB=/usr/share/perl5 to ~/.bashrc file should resolve the issue.

Upvotes: 1

Related Questions