Monday, 3 March 2014

Install Git's manual pages

This is for you if you 

- Have downloaded the latest tarball of git manual pages and wish to install it to learn more about the latest exciting stuff in the released git version.

- Have compiled git's source code from scratch, installed it and now wish to install the relevant manual pages that have come with the source so that you know what you have in your git armoury.


Assuming you have source, how to generate the git manual pages and install them on your linux box.
Run:

Run the target "dist-doc" to generate the manual page in the following way:
# make dist-doc

Above will create a tarball of manual pages that will contain the following directories :
man1,man5 and man7

You can obtain this information if you hack the Makefile. Copying an excerpt of the target code below:

manpages = git-manpages-$(GIT_VERSION)  # This is what your git manual pages tarball will be named as
dist-doc:
        $(RM) -r .doc-tmp-dir
        mkdir .doc-tmp-dir
        $(MAKE) -C Documentation WEBDOC_DEST=../.doc-tmp-dir install-webdoc
        cd .doc-tmp-dir && $(TAR) cf ../$(htmldocs).tar .
        gzip -n -9 -f $(htmldocs).tar
        :
        $(RM) -r .doc-tmp-dir
        mkdir -p .doc-tmp-dir/man1 .doc-tmp-dir/man5 .doc-tmp-dir/man7
        $(MAKE) -C Documentation DESTDIR=./ \
                man1dir=../.doc-tmp-dir/man1 \
                man5dir=../.doc-tmp-dir/man5 \
                man7dir=../.doc-tmp-dir/man7 \
                install
        cd .doc-tmp-dir && $(TAR) cf ../$(manpages).tar .
        gzip -n -9 -f $(manpages).tar
        $(RM) -r .doc-tmp-dir


Now to install it,
# sudo tar -xzvf git-manpages-1.9.0.tar.gz -C /usr/local/share/man

With above, I have installed teh manual pages in  /usr/local/share/man. git-manpages-1.9.0.tar.gz was the tarball in my case and may differ depending upon the version you compiled and want to install.

Verification :

Now, how do you verify if the latest manual pages are installed or not:
Hmm, Run this:
# git --version
Check the version that shows up

Now, open a manual page for any of the git commands. Example:
# git checkout --help
Scroll down this manual page and look on the bottom left . Git's version is displayed there.
It should match what you obtained earlier with "git --version".





2 comments:

  1. One command which I find useful is

    git whatchanged -n 1

    ReplyDelete
  2. Thanks. You may want to post it here :

    http://mayur-loves-git.blogspot.com.au/2014/03/if-one-wants-to-see-commits-that-are-in.html

    ReplyDelete