在我的 Xubuntu 14.04 系统上,我使用安装了 Git
sudo apt-get install git
它工作正常(我才刚刚开始学习它),但是执行
git diff
返回
error: cannot run sensible-paper: No such file or directory
作为它的第一行。在第一行之后,它给出了文件之间的差异,换句话说,一切正常。
此外,命令
man git
(或任何其他帮助命令,如 git help commit
)返回:
man: can't execute sensible-paper: No such file or directory
man: command exited with status 255: (cd /home/max/Desktop/Git Learning && LESS=-ix8RmPm Manual page git-commit(1) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h for help or q to quit)$PM Manual page git-commit(1) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h for help or q to quit)$ MAN_PN=git-commit(1) sensible-paper)
因此我根本无法获得有关 Git 的任何帮助(从我的 shell)。 我用谷歌搜索了解决方案,但找不到与上述错误类似的任何内容。 任何帮助表示赞赏。
最佳答案
sensible-paper
显然是 sensible-pager
的错别字,应该是默认执行的pager。
要找出错误设置的环境变量,您可以运行
env | grep sensible-paper
无论如何要让 Git 使用 sensible-pager,运行
git config --global core.pager sensible-pager
关于linux - Git 命令执行(如 "git diff"或 "git help commit")返回关于 "sensible-paper"的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26524559/