繁体   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