temporary_user_name
temporary_user_name

Reputation: 37108

How can I view the options for a git command in the console?

Usually I accomplish this by typing in some fake options so that it tells me all the real ones when it sees I clearly don't know what I'm doing.

What's the ACTUAL way to get it to list all the options for a command?

Example of what I do presently:

$ 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

Upvotes: 0

Views: 224

Answers (3)

temporary_user_name
temporary_user_name

Reputation: 37108

Per Brian Roach in the comments:

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

Upvotes: 1

mipadi
mipadi

Reputation: 411340

You can view the man page by running man git-<subcommand> or git <subcommand> --help.

Upvotes: 0

bcr
bcr

Reputation: 1328

Perhaps you mean man git-[command] ? (e.g. man git-push)

Upvotes: 1

Related Questions