5

In the man page of git, there is a line which says:

See gittutorial(7) to get started, then see giteveryday(7) for a useful minimum set of commands.
The Git User’s Manual[1] has a more in-depth introduction.

How do I see the "The Git User's Manual[1]" from the terminal it self, instead of looking it up on the internet.

Hari Om
  • 69
  • 8
  • In which environment are you using git? Linux, windows? – Mehdi Oct 30 '18 at 13:22
  • I am using it in Linux. – Hari Om Oct 30 '18 at 13:23
  • The spelling on that note is not very helpful, but on Linux `locate` is a first resort, you can locate files with e.g. `locate user-manual.html` which on my install finds that user manual, and only that user manual. – jthill Nov 01 '18 at 15:38

6 Answers6

6

The [1] part from Git User’s Manual[1] says it is a note.

Read until the end of the manual page (press the space bar to jump one page below) to go to the NOTES sections.

The first note is:

NOTES
    1. Git User’s Manual
       git-htmldocs/user-manual.html

git-htmldocs/user-manual.html is not a valid URL and it doesn't mean anything to me.

But the first section of man git (where you extracted the fragment you posted in the question) also says:

A formatted and hyperlinked copy of the latest Git documentation can be viewed at https://git.github.io/htmldocs/git.html.

At https://git.github.io/htmldocs/git.html there is the same documentation as HTML and the Git User's Manual link in this documentation points to: https://git.github.io/htmldocs/user-manual.html


You can also read the Git documentation on its website: https://git-scm.com/docs

axiac
  • 68,258
  • 9
  • 99
  • 134
1

For example, for the command, git clone <repo>, you can either use:

$ man git-clone

or:

$ git help clone

fabfas
  • 2,200
  • 1
  • 21
  • 21
  • I don't think that's what OP is asking. "The Git User's Manual[1]" looks like it should link somewhere. That's what OP is looking for. – ChrisGPT was on strike Oct 30 '18 at 13:25
  • That's for a specific command, I know that. What I want to know is, when it says "see gittutorial(7)", I can see it using `$man gittutorial`, but how do I see `The Git User's Manual[1]` ? – Hari Om Oct 30 '18 at 13:27
1

At the bottom of man git there are some reference links. The footnote number after "The Git User's Manual" should correspond to one of those links. On my machine I see

1. Git User’s Manual
   file:///usr/share/doc/git-doc/user-manual.html

So on my machine I can view /usr/share/doc/git-doc/user-manual.html. You can use a CLI browser like links to simplify reading the HTML:

links /usr/share/doc/git-doc/user-manual.html

Edit: On my machine that file doesn't actually exist, and I don't see an Arch Linux package providing it. Hopefully the Git documentation on your machine is complete.

If your documentation is also missing and you don't mind hitting the network you can browse the User's Manual from Git's website, e.g.:

links https://git-scm.com/docs/user-manual.html
ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
  • 1
    The main thing that needed to be explained here was "a number in brackets means a footnote". They're not usually found in man pages, but it's a rule that applies to plain text documents in general. (Assuming we all understand that `[]` are brackets and `()` are parentheses) –  Oct 30 '18 at 13:34
  • @WumpusQ.Wumbley That makes so much sense now. The file actually doesn't on my machine too. Looks like I have to use the one on the net. – Hari Om Oct 30 '18 at 13:38
1

The Git User's Manual is a part of git itself. It can be accessed by cloning the git repository hosted at kernel.org.

The file you are looking for is Documentation/user-manual.txt. To access it in the terminal, clone one of these:

git://git.kernel.org/pub/scm/git/git.git
https://git.kernel.org/pub/scm/git/git.git
https://kernel.googlesource.com/pub/scm/git/git.git

You can also clone just the docs without the rest of git from the git-htmldocs repository listed here. These include both the asciidoctor source and the rendered HTML.

Note that for browsing with just a web browser, the content is published here.

Grant Zvolsky
  • 483
  • 5
  • 6
0

The git user manual may be downloaded in txt format, here is its location:

https://raw.githubusercontent.com/git/git/master/Documentation/user-manual.txt

It can be downloaded using wget or curl commands.

Then it can be read using less, or perhaps a combination of cat and grep

Example:

## read the first 150 lines of chapter 'Exploring Git history'
cat user-manual.txt | grep "Exploring Git history" -A 150
Mehdi
  • 7,204
  • 1
  • 32
  • 44
0

That answer is combination of already present ones plus explanation how to add file if it is not available locally.

When I run man git on my Linux, it has a phrase too:

The Git User’s Manual[1]

It looks like a footnote and indeed near the the end of man page I see:

    1. Git User’s Manual
       file:///usr/share/doc/git/html/user-manual.html

However the file is absent:

$ ls /usr/share/doc/git/html/user-manual.html
ls: cannot access '/usr/share/doc/git/html/user-manual.html': No such file or directory

I was not able to find package to add it via apt-get install (during the search I've found that Q&A). To add it I used:

git clone https://github.com/git/htmldocs.git

The file is user-manual.html in htmldocs folder, I copied it

sudo mkdir --parents /usr/share/doc/git/html
sudo cp htmldocs/user-manual.html /usr/share/doc/git/html

Then one open it via web browser, e.g. as suggested in another answer with:

links /usr/share/doc/git/html/user-manual.html

(after sudo apt-get install links as mainstream Linux distros do not have it installed by default).

Martian2020
  • 307
  • 3
  • 12