阅读Git手册页的资源?

时间:2013-11-17 21:37:17

标签: git command-line

我有兴趣学习如何在Git Man页面上阅读命令行语法。例如,以下内容出现在this页面

的概要中
git [--version] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
    [-p|--paginate|--no-pager] [--no-replace-objects]
    [--bare] [--git-dir=<path>] [--work-tree=<path>]
    [-c <name>=<value>]
    [--help] <command> [<args>]

有人可以提供有关如何阅读此语法的说明或资源吗? Google搜索会显示Windows和IBM语法的结果,但我找不到任何有关Linux类型命令的信息。

1 个答案:

答案 0 :(得分:1)

  • 方括号中的单词是可选的
  • 管道(|)使括号内的东西互相排斥
  • 尖括号是任何类型信息的占位符
  • 不以---开头的字词是文件名等内容的占位符。

(来自man-pages(7)

SYNOPSIS      briefly describes the command or function's interface.
             For commands, this shows the syntax of the command and
             its arguments (including options); boldface is used for
             as-is text and italics are used to indicate replaceable
             arguments.  Brackets ([]) surround optional arguments,
             vertical bars (|) separate choices, and ellipses (...)
             can be repeated.  For functions, it shows any required
             data declarations or #include directives, followed by
             the function declaration.