Andy
Andy

Reputation: 49

display ALL the information of a command with 'git anycommand -h'

I just found out a very useful option to use with the "git log" command: "-p". But if I write "git log -h" in windows git bash I don't get any information about the "-p" option, no way to discover it if I don't know it exists. Do you know what I can type to get all the information about the "log" command, and, in general, any command? Thank you.

Upvotes: 2

Views: 117

Answers (3)

xdhmoore
xdhmoore

Reputation: 9915

I think the key is in this line from the git log help page:

The command takes options applicable to the git-rev-list[1] command to control what is shown and how, and options applicable to the git-diff[1] command to control how the changes each commit introduces are shown.

So, git log can also take the options passable to git rev-list and git diff. In this case, the -p flag is documented on the page for git-diff, which you can also get to with git help diff.

Upvotes: 0

Andy
Andy

Reputation: 49

I found the answer I was looking for. In fact, "log" and "diff" have common options. So you get all the info you need if you type "git diff -h", instead! There you go!

Upvotes: -1

Nino Filiu
Nino Filiu

Reputation: 18551

You can try out any of these

git help log
man git-log

Git commands are also readable online at https://git-scm.com/docs/git-COMMAND, git log is here for example. It's basically the same as git help COMMAND but some would find it easier to read.

Upvotes: 3

Related Questions