章节 ▾
第二版
-
A1. 附录 A:其他环境下的 Git
- A1.1 图形界面
- A1.2 Visual Studio 中的 Git
- A1.3 Visual Studio Code 中的 Git
- A1.4 IntelliJ / PyCharm / WebStorm / PhpStorm / RubyMine 中的 Git
- A1.5 Sublime Text 中的 Git
- A1.6 Bash 中的 Git
- A1.7 Zsh 中的 Git
- A1.8 PowerShell 中的 Git
- A1.9 总结
-
A2. 附录 B:在应用程序中嵌入 Git
-
A3. 附录 C:Git 命令
1.7 起步 - 获取帮助
获取帮助
如果您在使用 Git 时需要帮助,有三种等效的方法可以获取任何 Git 命令的完整手册页 (manpage) 帮助
$ git help <verb>
$ git <verb> --help
$ man git-<verb>
例如,您可以通过运行以下命令来获取 git config
命令的手册页帮助
$ git help config
这些命令很好,因为您可以随时随地访问它们,即使离线也是如此。 如果手册页和本书不够,您需要面对面的帮助,您可以尝试 Libera Chat IRC 服务器上的 #git
、#github
或 #gitlab
频道,网址为 https://libera.chat/。 这些频道经常有数百人参与,他们都非常了解 Git,并且经常愿意提供帮助。
此外,如果您不需要完整的manpage帮助,而只需要快速了解Git命令的可用选项,您可以使用-h
选项请求更简洁的“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
--renormalize renormalize EOL of tracked files (implies -u)
-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
--sparse allow updating entries outside of the sparse-checkout cone
--chmod (+|-)x override the executable bit of the listed files
--pathspec-from-file <file> read pathspec from file
--pathspec-file-nul with --pathspec-from-file, pathspec elements are separated with NUL character