Reputation: 26315
For certain subcommands in git, if I do not specify any parameters I get a convenient "usage" output for that command. Example:
$ git blame
usage: git blame [options] [rev-opts] [rev] [--] file
[rev-opts] are documented in git-rev-list(1)
--incremental Show blame entries as we find them, incrementally
-b Show blank SHA-1 for boundary commits (Default: off)
--root Do not treat root commits as boundaries (Default: off)
--show-stats Show work cost statistics
--score-debug Show output score for blame entries
-f, --show-name Show original filename (Default: auto)
-n, --show-number Show original linenumber (Default: off)
-p, --porcelain Show in a format designed for machine consumption
--line-porcelain Show porcelain format with per-line commit information
-c Use the same output mode as git-annotate (Default: off)
-t Show raw timestamp (Default: off)
-l Show long commit SHA1 (Default: off)
-s Suppress author name and timestamp (Default: off)
-e, --show-email Show author email instead of name (Default: off)
-w Ignore whitespace differences
--minimal Spend extra cycles to find better match
-S <file> Use revisions from <file> instead of calling git-rev-list
--contents <file> Use <file>'s contents as the final image
-C[<score>] Find line copies within and across files
-M[<score>] Find line movements within and across files
-L <n,m> Process only line range n,m, counting from 1
--abbrev[=<n>] use <n> digits to display SHA-1s
However, some subcommands actually do things when no parameters are passed, such as git log
for example. I've reviewed the documentation for git help
but I don't see a way to simply display 'usage' for a command instead of pulling up my web browser. Does anyone know how I can force a subcommand to display its usage information to the command line like git blame
did?
I'm using msysgit 1.9.2 on Windows. Thanks in advance.
Upvotes: 3
Views: 94
Reputation: 8333
Use git add -h
instead of git add --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
-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
Upvotes: 5