当我运行git checkout --patch origin / master file.java时,我看到:
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.
我在Ubuntu 12.04.4 LTS上运行它。 git的版本是1.7.9.5。 perl是perl5,版本20,颠覆0(v5.20.0)为x86_64-linux构建。
答案 0 :(得分:1)
/usr/share/perl5/Git.pm
中可能缺少 PATH
(或类似情况,具体取决于系统)。
将export PERL5LIB=/usr/share/perl5
添加到~/.bashrc
文件可以解决问题。