如何在控制台中查看git命令的选项?

时间:2014-04-14 20:22:06

标签: git

通常我会通过输入一些假的选项来实现这一点,这样当它看到我明显不知道自己在做什么时它会告诉我所有真实的选项。

使用ACTUAL方式列出命令的所有选项是什么?

我现在做的例子:

$ git push -aslivuq --fake-flag

error: unknown switch `a'
usage: git push [<options>] [<repository> [<refspec>...]]

    -v, --verbose         be more verbose
    -q, --quiet           be more quiet
    --repo <repository>   repository
    --all                 push all refs
    --mirror              mirror all refs
    --delete              delete refs
    --tags                push tags (can't be used with --
    -n, --dry-run         dry run
    --porcelain           machine-readable output
    -f, --force           force updates
    --force-with-lease[=<refname>:<expect>]
                          require old value of ref to be a
    --recurse-submodules[=<check>]
                          control recursive pushing of sub
    --thin                use thin pack
    --receive-pack <receive-pack>
                          receive pack program
    --exec <receive-pack>
                          receive pack program
    -u, --set-upstream    set upstream for git pull/status
    --progress            force progress reporting
    --prune               prune locally removed refs
    --no-verify           bypass pre-push hook
    --follow-tags         push missing but relevant tags

3 个答案:

答案 0 :(得分:1)

也许你的意思是man git-[command]? (例如man git-push

答案 1 :(得分:1)

Per Brian Roach在评论中说:

git <command> -h or git help <command> for a full man page.

答案 2 :(得分:0)

您可以通过运行man git-<subcommand>git <subcommand> --help来查看手册页。