簡體   English   中英

Windows命令提示符下的git help

[英]git help in Windows command prompt

Windows上的git help命令( msysgit發行版)每次運行時都會生成Web瀏覽器。 我試過git help -m報告"No manual entry for ..."git help -i ,其中說"info: Terminal type 'msys' is not smart enough to run Info." Cygwin下的bash

cmd終端有沒有明智的方法來獲得輕量級的幫助?

它適用於特定命令: git <command> -h

編輯 ,感謝@ the-happy-hippo

但它只顯示了一個簡短的描述,而不是完整的描述,因為git help <command>git <command> --help在Windows上提供。

Git 2.x的更新(2017年6月,Git 2.13.1)

你還沒有男人:

> git -c help.format=man help add
warning: failed to exec 'man': No such file or directory
fatal: no man viewer handled the request

對於git <verb> --help
git <verb> -h不打印手冊頁,只有短用法部分(與人無關)


不,即使基於htlp txt文件的'cat'的替代方案,也建議在“ 如何讓git在Windows中顯示命令行幫助? ”。

有人man.<tool>.cmd在2008年推出的man.<tool>.cmd config ,允許設置自定義命令,但msys shell不隨man.exe一起提供。

解決此問題的世界上最過分的工作方式:使用WSL

(也就是說,除非您已經是WSL用戶,在這種情況下,它只是一個普通的解決方法)

  1. 通過Windows應用商店安裝一個Linux發行版
  2. 進入並確保它已安裝git包
  3. 從Windows命令行, bash -c 'git help fetch'等。

這是最后一個的別名:

[alias]
    hep = "!f() { $SYSTEMROOT/System32/bash -c \"git help $1\"; }; f"

(並且你不能覆蓋git內置函數,但是你可以創建一個shell命令來攔截和重新路由help 。)

git <verb> -h顯示同一終端窗口中的命令用法。

另一方面, git <verb> --helpgit help <verb>打開一個瀏覽器。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM