git獲取幫助出現No manual entry for git-<verb>的解決辦法

使用 Git 時需要獲取幫助,有三種方法可以找到 Git 命令的使用手冊:
$ git help <verb>
$ git <verb> --help
$ man git-<verb>
例如,要想獲得 config 命令的手冊,執行
$ git help config
這些命令的好處是隨時隨地可以使用而無需聯網。

[root@localhost ~]# git help config
No manual entry for git-config
[root@localhost ~]# git --version
git version 2.9.3

如上git的幫助命令不能用,提示:No manual entryfor git-<verb>
是因為git的幫助文檔(man page)缺失導致,可以去git的man文件夾驗證下(路徑是/usr/local/share/man目錄)。

解決方法:可以從以下兩個地方下載比較權威的man page文檔:

  1. http://code.google.com/p/git-core/downloads/list
  2. 從以下地址git clone
    git://git.kernel.org/pub/scm/git/git-manpages.git
    https://git.kernel.org/pub/scm/git/git-manpages.git
    https://kernel.googlesource.com/pub/scm/git/git-manpages.git

將下載下來的man page文件拷貝進git的man文件夾里即可。
CLI命令如下:

[root@localhost ~]# cd /usr/local/share/man   
[root@localhost man]# git clone http://git.kernel.org/pub/scm/git/git-manpages.git 
[root@localhost man]# ls
git-manpages  man1x  man2x  man3x  man4x  man5x  man6x  man7x  man8x  man9x
man1          man2   man3   man4   man5   man6   man7   man8   man9   mann
[root@localhost man]# ls git-manpages/  
man1  man5  man7
[root@localhost man]# cp -r /usr/local/share/man/git-manpages/* /usr/local/share/man/  
[root@localhost man]# git help config
驗證發現出現了幫助信息,這樣就可以使用git help命令咯
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容

  • git[編輯]維基百科,自由的百科全書 git gitweb,git的一個Web界面。 原作者林納斯·托瓦茲 開發...
    半片殘楓閱讀 442評論 0 0
  • Spring Cloud為開發人員提供了快速構建分布式系統中一些常見模式的工具(例如配置管理,服務發現,斷路器,智...
    卡卡羅2017閱讀 134,969評論 19 139
  • 本文作者陳云峰,轉載請注明。 這篇文章記錄個人常用的一些命令,和記不住的一些命令,轉載了并不斷更新。 Git官網 ...
    陳云峰閱讀 2,846評論 0 24
  • “金子般的美妙時光曾在生命中蕩漾,我們卻視而不見,任憑沙石掩埋;a曾降臨我們身邊,我們卻渾然不覺,唯有她離去時才恍...
    當時只道是尋常閱讀 1,004評論 0 6
  • 讀初中那會,我的成績還算拔尖,后來考上了中專。那時,最樸素的想法是,畢業后能跳出農門。然而事實并非想像,作為最后一...
    夢里李大俠閱讀 223評論 6 2