Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

search the whole git subcommands, guides and overview man pages

Tags:

git

bash

We can search whole man page using man -wK.

We can get the git subcommands using git help -a. We can get common git guides using git help -g.

For an overview of the system we can use git help git. To check the man page of a particular subcommand we can use, for example git help add. To check the man page of a particular guides we can use, for example git help cli.

I am interested to search the whole git (its subcommands, guides and overview man pages).

How can I do that?

like image 202
blueray Avatar asked Oct 15 '25 16:10

blueray


2 Answers

I usually:

  • clone https://github.com/git/git
  • go to the Documentation folder
  • do a git grep "The-term-I-want-know-about"

That will search in all:

  • how-to guides
  • technical guides
  • release notes
  • man pages
like image 160
VonC Avatar answered Oct 18 '25 10:10

VonC


For commands (not guides):

git --list-cmds=main,builtins | xargs -n 1 -I {} man git {} | cat | less

You could also expand that list.

For guides:

git --list-cmds=list-guide | xargs -n 1 -I {} man git{} | cat | less

That’s a separate invocation since those are spelled e.g. giteveryday.

If you want both of them at the same time:

cmds=$(mktemp)
git --list-cmds=main,builtins | xargs -n 1 -I {} man git {} | cat > $cmds
guides=$(mktemp)
git --list-cmds=list-guide | xargs -n 1 -I {} man git{} | cat > $guides
cat $cmds $guides | less
rm $cmds $guides
like image 38
Guildenstern Avatar answered Oct 18 '25 12:10

Guildenstern



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!