Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使git输出用于任何命令?_Git - Fatal编程技术网

如何使git输出用于任何命令?

如何使git输出用于任何命令?,git,Git,对于git中的某些子命令,如果我没有指定任何参数,我将为该命令获得一个方便的“用法”输出。例如: $ git blame usage: git blame [options] [rev-opts] [rev] [--] file [rev-opts] are documented in git-rev-list(1) --incremental Show blame entries as we find them, incrementally -b

对于git中的某些子命令,如果我没有指定任何参数,我将为该命令获得一个方便的“用法”输出。例如:

$ git blame
usage: git blame [options] [rev-opts] [rev] [--] file

    [rev-opts] are documented in git-rev-list(1)

    --incremental         Show blame entries as we find them, incrementally
    -b                    Show blank SHA-1 for boundary commits (Default: off)
    --root                Do not treat root commits as boundaries (Default: off)
    --show-stats          Show work cost statistics
    --score-debug         Show output score for blame entries
    -f, --show-name       Show original filename (Default: auto)
    -n, --show-number     Show original linenumber (Default: off)
    -p, --porcelain       Show in a format designed for machine consumption
    --line-porcelain      Show porcelain format with per-line commit information
    -c                    Use the same output mode as git-annotate (Default: off)
    -t                    Show raw timestamp (Default: off)
    -l                    Show long commit SHA1 (Default: off)
    -s                    Suppress author name and timestamp (Default: off)
    -e, --show-email      Show author email instead of name (Default: off)
    -w                    Ignore whitespace differences
    --minimal             Spend extra cycles to find better match
    -S <file>             Use revisions from <file> instead of calling git-rev-list
    --contents <file>     Use <file>'s contents as the final image
    -C[<score>]           Find line copies within and across files
    -M[<score>]           Find line movements within and across files
    -L <n,m>              Process only line range n,m, counting from 1
    --abbrev[=<n>]        use <n> digits to display SHA-1s
$git
用法:git[options][rev opts][rev][--]文件
[版本选项]记录在git版本列表(1)中
--增量在我们找到条目时以增量方式显示它们
-b为边界提交显示空白SHA-1(默认值:关闭)
--根用户不将根用户提交视为边界(默认值:关闭)
--显示统计信息显示工作成本统计信息
--分数调试显示错误条目的输出分数
-f、 --显示名称显示原始文件名(默认值:自动)
-n、 --显示编号显示原始行号(默认值:关闭)
-p、 --以机器消费设计的形式展示瓷器
--行瓷器显示带有每行提交信息的瓷器格式
-c使用与git annotate相同的输出模式(默认值:off)
-t显示原始时间戳(默认值:关闭)
-l显示长提交SHA1(默认值:关闭)
-s禁止显示作者姓名和时间戳(默认值:关闭)
-e、 --显示电子邮件显示作者电子邮件而不是姓名(默认值:关闭)
-忽略空格差异
--最少花费额外的周期来找到更好的匹配
-S使用来自的修订,而不是调用git rev list
--内容使用的内容作为最终图像
-C[]查找文件内和文件间的行副本
-M[]查找文件内和文件间的行移动
-L仅处理线范围n,m,从1开始计数
--abbrev[=]使用数字显示SHA-1
但是,有些子命令实际上在没有传递参数时执行操作,例如
git log
。我已经查看了git help的文档,但是我没有看到一种简单地显示命令“用法”而不是打开web浏览器的方法。有人知道我如何强制子命令在命令行上显示其使用信息,比如
git-dull
did吗


我正在Windows上使用msysgit 1.9.2。提前感谢。

使用
git-add-h
而不是
git-add-help

[:~] $ git add -h
usage: git add [options] [--] <pathspec>...

    -n, --dry-run         dry run
    -v, --verbose         be verbose

    -i, --interactive     interactive picking
    -p, --patch           select hunks interactively
    -e, --edit            edit current diff and apply
    -f, --force           allow adding otherwise ignored files
    -u, --update          update tracked files
    -N, --intent-to-add   record only the fact that the path will be added later
    -A, --all             add changes from all tracked and untracked files
    --ignore-removal      ignore paths removed in the working tree (same as --no-all)
    --refresh             don't add, only refresh the index
    --ignore-errors       just skip files which cannot be added because of errors
    --ignore-missing      check if - even missing - files are ignored in dry run
[:~]$git add-h
用法:git添加[options][--]。。。
-n、 --试运行试运行
-v、 ——冗长
-i、 --交互式拣选
-p、 --以交互方式修补选择大块
-e、 --编辑当前差异并应用
-f、 --强制允许添加其他被忽略的文件
-u、 --更新跟踪的文件
-N、 --仅添加记录的意图—路径将在以后添加
-A、 --所有添加来自所有跟踪和未跟踪文件的更改
--忽略删除忽略在工作树中删除的路径(与--no all相同)
--刷新不添加,只刷新索引
--忽略错误只跳过由于错误而无法添加的文件
--忽略丢失检查是否在试运行中忽略文件(甚至丢失)

通常我会添加
git-help
,但是
--help
-h
有根本不同吗?这有点奇怪:)