![如何阅读 git revert 的手册页?](https://linux22.com/image/1456593/%E5%A6%82%E4%BD%95%E9%98%85%E8%AF%BB%20git%20revert%20%E7%9A%84%E6%89%8B%E5%86%8C%E9%A1%B5%EF%BC%9F.png)
当我执行 a 时man git revert
,我得到了 git 的手册页:
NAME
git - the stupid content tracker
SYNOPSIS
git [--version] [--help] [-C <path>] [-c <name>=<value>]
[--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
[-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
[--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
<command> [<args>]
DESCRIPTION
Git is a fast, scalable, distributed revision control system with an
unusually rich command set that provides both high-level operations and
full access to internals.
...
revert
是<command>
上面列出的。当我尝试时man revert
,我得到:
$ man revert
No manual entry for revert
我怎样才能阅读的手册页git revert
?
答案1
Git 有自己的帮助系统,可通过 调用git help <command>
,如使用说明所示:
'git help -a' and 'git help -g' lists available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.
因此,要获取git revert
使用信息
$ git help revert
GIT-REVERT(1) Git Manual GIT-REVERT(1)
NAME
git-revert - Revert some existing commits
等等。您可能还对以下内容感兴趣git scm 文档,我发现这对我理解非常有帮助git
;现在仍然参考它。
答案2
这很有趣;当我说时man git revert
,它会显示git-revert(1)
。但无论如何,如果你向下滚动大约 20% 进入git(1)
, 你会看到的
Git 命令
⋮
其次是
git-revert(1)
恢复现有的提交。
这就是你学会说的方式man git-revert
。