Git 帮助
如果你忘记了命令或命令的选项,你可以使用 Git 帮助。
在命令行中,有几种不同的使用帮助命令的方式:
git command -help
- 查看特定命令的所有可用选项git help --all
- 查看所有可能的命令
让我们看看不同的命令。
Git -help 查看特定命令的选项
任何时候,如果你需要帮助来记住特定命令的选项,你可以使用 git command -help
:
这将显示特定命令的所有可用选项:
usage: git commit [] [--] ...
-q, --quiet suppress summary after successful commit
-v, --verbose show diff in commit message template
Commit message options
-F, --file read message from file
--author override author for commit
--date override date for commit
-m, --message
commit message
-c, --reedit-message
reuse and edit message from specified commit
-C, --reuse-message
reuse message from specified commit
--fixup use autosquash formatted message to fixup specified commit
--squash use autosquash formatted message to squash specified commit
--reset-author the commit is authored by me now (used with -C/-c/--amend)
-s, --signoff add a Signed-off-by trailer
-t, --template
use specified template file
-e, --edit force edit of commit
--cleanup how to strip spaces and #comments from message
--status include status in commit message template
-S, --gpg-sign[=]
GPG sign commit
Commit contents options
-a, --all commit all changed files
-i, --include add specified files to index for commit
--interactive interactively add files
-p, --patch interactively add changes
-o, --only commit only specified files
-n, --no-verify bypass pre-commit and commit-msg hooks
--dry-run show what would be committed
--short show status concisely
--branch show branch information
--ahead-behind compute full ahead/behind values
--porcelain machine-readable output
--long show status in long format (default)
-z, --null terminate entries with NUL
--amend amend previous commit
--no-post-rewrite bypass post-rewrite hook
-u, --untracked-files[=]
show untracked files, optional modes: all, normal, no. (Default: all)
--pathspec-from-file
read pathspec from file
--pathspec-file-nul with --pathspec-from-file, pathspec elements are separated with NUL character
Note: You can also use --help instead of -help to open the relevant Git manual page
### Git help --all 查看所有可能的命令
要列出所有可能的命令,可以使用 `help