Git man page seems incorrect

I’m new to git, so please excuse me if this is a dumb question.

I have installed git 1.7.7.4 from source on SLES Linux, and all looks good. I have added the following to $MANPATH:

/usr/local/git-1.7.7.4/share/man

When I do man git, I’m presented with

Git(3)         User Contributed Perl Documentation         Git(3)

NAME
       Git - Perl interface to the Git version control system

SYNOPSIS
...

This doesn’t look like a man page for the git command I use from the command line. Or is it? Sounds like something for perl, obviously. Here is an online version of the full man page I’m seeing.

If this is not the correct man pages, where can I find them? I can give a directory listing of my git install if needed. Thanks.

  • SSH.NET - An established connection was aborted by the software in your host machine
  • Suse Enterprise 11 SP2 how to install git
  • 6 Solutions collect form web for “Git man page seems incorrect”

    Update git 2.8 (March 2016)

    The installation from sources mentions, in order to build the doc and man pages:

    $ make all doc info
    $ sudo make install install-doc install-html install-info
    

    I confirm a man git will directly get you man (1) git.
    It content differs from the git README which just lost the snarky “stupid content tracker” (said README is now a markdown-enabled README.md!)

    README.md: don’t call git stupid in the title

    “the stupid content tracker” was true in the early days of Git, but hardly applicable these days.
    “fast, scalable, distributed” describes Git more accurately.

    Also, “stupid” can be seen as offensive by some people. Let’s not use it
    in the very first words of the README.

    The man page should soon follow suit.

    You can build the man pages from the source package with make man && make install-man. Manual pages are not built by default, see git’s INSTALL file:

    To build and install documentation suite, you need to have
    the asciidoc/xmlto toolchain. Because not many people are
    inclined to install the tools, the default build target
    (“make all”) does not build them.

    “make doc” builds documentation in man and html formats; there are
    also “make man”, “make html” and “make info”. Note that “make html”
    requires asciidoc, but not xmlto. “make man” (and thus make doc)
    requires both.

    You are getting the incorrect section of the man pages for git. The information you want is in section 1. Use man 1 git to get correct manual section.

    You can see list of available manual sections here.

    You probably want man 1 git:

    $ man 1 git
    
    GIT(1)                              Git Manual                             GIT(1)
    
    NAME
           git - the stupid content tracker
    
    SYNOPSIS
           git [--version] [--exec-path[=<path>]] [--html-path]
               [-p|--paginate|--no-pager] [--no-replace-objects]
               [--bare] [--git-dir=<path>] [--work-tree=<path>]
               [-c <name>=<value>]
               [--help] <command> [<args>]
    
    ...
    

    The source for git does not include the documentation. Try:

    $ git archive origin/man | sudo tar -x -C /usr/local/share/man
    

    in a git working directory of git to install in /usr/local/share.

    Do what they (other answer-ers) said, and if you still have the same problem (or anyone else does) make sure you don’t have the MANSECT environment variable set, which would cause this problem to happen too. It’s a colon-separated list of sections to check, in descending order (first section tried is at the beginning of the list, last one is at the end). If I MANSECT=3, I can duplicate your problem however depending on how experienced of a user you are, it might seem like an obvious thing. Last but not least, make that sure no aliases, functions (bash) or scripts that intercept the ‘man’ command, are set (because man –section will explicitly tell man which section to search, in the same format as MANSECT) for man, since –Section overrides the MANSECT variable. While your at it check the MANOPT variable for any ‘–section 3’ or ‘-s3’ flags (but you would have probably noticed that by now since it would break many queries). Make sure also that MANPATH is exported, it doesn’t do any good if it is just locally declared (same with the other variables). Lastly if all else fails you can manually install the pages yourself, which isn’t too hard unless you are severely restricted on what you are allowed to do to the system you are using (a place I used to work for had a rule that nobody was allowed to change ANY defaults even if they had access to do so, due to inexperienced people making bad changes). Another thing to watch out for is symbolic links (ie, /etc/alternatives), which now and again, become unlinked however man usually warns you about this.

    Git Baby is a git and github fan, let's start git clone.