2012-02-15 21:45:35 +08:00
<?xml version="1.0" encoding="ISO-8859-1"?>
< !DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../../general.ent">
%general-entities;
2017-08-16 02:49:48 +08:00
<!ENTITY git-root "&kernel-dl;/software/scm/git" >
2014-01-27 12:37:49 +08:00
2014-01-27 23:22:56 +08:00
<!ENTITY git-download-http "&git-root;/git-&git-version;.tar.xz">
2017-03-07 03:07:51 +08:00
<!ENTITY git-download-ftp " ">
2022-05-09 04:01:14 +08:00
<!ENTITY git-md5sum "b069d4919c8d9faf28db4fd90feb8e1d">
2021-03-21 07:48:51 +08:00
2022-05-09 04:01:14 +08:00
<!ENTITY git-size "6.7 MB">
2022-01-26 03:47:27 +08:00
<!-- but people keep forgetting that an install not only needs the net build
2019-12-11 12:08:33 +08:00
space, it also needs the install space (or DESTDIR) -->
2022-04-20 02:35:37 +08:00
<!ENTITY git-buildsize "351 MB (with downloaded documentation, add 17 MB to build documentation)">
2019-08-18 06:16:30 +08:00
<!-- With 2.23.0, there was a large increase in time for tests. Possibly disk related? -->
2020-03-02 08:54:00 +08:00
<!-- Confirmed that it is disk related. -->
2022-05-09 04:01:14 +08:00
<!ENTITY git-time "0.4 SBU (with parallelism=4; add 0.4 SBU for building documentation and 6 SBU (disk speed dependent) for tests, both with parallelism=4)">
2012-02-15 21:45:35 +08:00
]>
<sect1 id= "git" xreflabel= "git-&git-version;" >
<?dbhtml filename="git.html"?>
<sect1info >
<date > $Date$</date>
</sect1info>
<title > Git-&git-version; </title>
<indexterm zone= "git" >
2013-03-02 03:29:01 +08:00
<primary sortas= "a-Git" > Git</primary>
2012-02-15 21:45:35 +08:00
</indexterm>
<sect2 role= "package" >
<title > Introduction to Git</title>
2013-03-02 03:29:01 +08:00
<para >
<application > Git</application> is a free and open source, distributed
version control system designed to handle everything from small to very
large projects with speed and efficiency. Every
<application > Git</application> clone is a full-fledged repository with
2015-02-08 21:40:43 +08:00
complete history and full revision tracking capabilities, not dependent
on network access or a central server. Branching and merging are fast and
easy to do. <application > Git</application> is used for version control of
2015-04-03 08:41:23 +08:00
files, much like tools such as <xref linkend= "mercurial" /> ,
2013-03-02 03:29:01 +08:00
<application > Bazaar</application> , <xref linkend= "subversion" /> ,
2015-09-10 19:09:47 +08:00
<ulink url= "http://www.nongnu.org/cvs/" > CVS</ulink> ,
<application > Perforce</application> , and
2013-03-02 03:29:01 +08:00
<application > Team Foundation Server</application> .
</para>
2012-02-15 21:45:35 +08:00
2022-02-17 12:44:55 +08:00
&lfs111_checked;
2012-02-15 21:45:35 +08:00
<bridgehead renderas= "sect3" > Package Information</bridgehead>
<itemizedlist spacing= "compact" >
<listitem >
2013-03-02 03:29:01 +08:00
<para >
Download (HTTP): <ulink url= "&git-download-http;" />
</para>
2012-02-15 21:45:35 +08:00
</listitem>
<listitem >
2013-03-02 03:29:01 +08:00
<para >
Download (FTP): <ulink url= "&git-download-ftp;" />
</para>
2012-02-15 21:45:35 +08:00
</listitem>
<listitem >
2013-03-02 03:29:01 +08:00
<para >
Download MD5 sum: &git-md5sum;
</para>
2012-02-15 21:45:35 +08:00
</listitem>
<listitem >
2013-03-02 03:29:01 +08:00
<para >
Download size: &git-size;
</para>
2012-02-15 21:45:35 +08:00
</listitem>
<listitem >
2013-03-02 03:29:01 +08:00
<para >
Estimated disk space required: &git-buildsize;
</para>
2012-02-15 21:45:35 +08:00
</listitem>
<listitem >
2013-03-02 03:29:01 +08:00
<para >
Estimated build time: &git-time;
</para>
2012-02-15 21:45:35 +08:00
</listitem>
</itemizedlist>
2012-02-24 07:53:00 +08:00
<bridgehead renderas= "sect3" > Additional Downloads</bridgehead>
<itemizedlist spacing= "compact" >
<listitem >
2013-03-02 03:29:01 +08:00
<para >
2014-01-27 12:37:49 +08:00
<ulink url= "&git-root;/git-manpages-&git-version;.tar.xz" >
2014-01-27 23:33:18 +08:00
&git-root; /git-manpages-&git-version; .tar.xz</ulink>
2016-06-10 00:46:30 +08:00
(not needed if you've installed <xref linkend= "asciidoc" /> ,
<xref linkend= "xmlto" /> , and prefer to rebuild them)
2013-03-02 03:29:01 +08:00
</para>
2012-02-24 07:53:00 +08:00
</listitem>
<listitem >
2013-03-02 03:29:01 +08:00
<para >
2014-01-27 12:37:49 +08:00
<ulink url= "&git-root;/git-htmldocs-&git-version;.tar.xz" >
2014-01-27 23:33:18 +08:00
&git-root; /git-htmldocs-&git-version; .tar.xz</ulink>
2016-06-10 00:46:30 +08:00
and other docs (not needed if you've installed
<xref linkend= "asciidoc" /> and want to rebuild the documentation).
2013-03-02 03:29:01 +08:00
</para>
2012-02-24 07:53:00 +08:00
</listitem>
</itemizedlist>
2012-02-15 21:45:35 +08:00
<bridgehead renderas= "sect3" > Git Dependencies</bridgehead>
<bridgehead renderas= "sect4" > Recommended</bridgehead>
2012-02-27 00:56:20 +08:00
<para role= "recommended" >
2019-01-27 22:10:07 +08:00
<xref linkend= "curl" /> (needed to use <application > Git</application> over
http, https, ftp or ftps)
2012-02-27 00:56:20 +08:00
</para>
2012-02-15 21:45:35 +08:00
<bridgehead renderas= "sect4" > Optional</bridgehead>
2012-02-27 00:56:20 +08:00
<para role= "optional" >
2021-08-04 22:17:15 +08:00
<xref role= "runtime" linkend= "gnupg2" /> (runtime, may be used to sign
2021-08-20 00:12:44 +08:00
<application > Git</application> commits or tags, or verify the signatures
2021-08-04 22:17:15 +08:00
of them),
2021-08-04 16:48:13 +08:00
<xref role= "runtime" linkend= "openssh" /> (runtime, needed to use
<application > Git</application> over ssh),
2017-08-06 09:08:11 +08:00
<xref linkend= "pcre2" /> (<emphasis > or</emphasis> the deprecated <xref
2019-09-20 22:15:17 +08:00
role="nodep" linkend="pcre"/>), in either case configured with
2017-08-06 09:08:11 +08:00
<literal > --enable-jit</literal> ,
2021-05-01 15:01:47 +08:00
<xref role= "runtime" linkend= "subversion" /> with Perl bindings
(runtime, for <command > git svn</command> ),
2017-09-16 03:46:45 +08:00
<xref role= "runtime" linkend= "tk" />
(gitk, a simple <application > Git</application>
2021-03-30 01:43:06 +08:00
repository viewer, uses <application > Tk</application> at runtime),
<xref linkend= "valgrind" /> ,
<ulink url= "https://metacpan.org/pod/Authen::SASL" > Authen::SASL</ulink> and
<ulink url= "https://metacpan.org/pod/MIME::Base64" > MIME::Base64</ulink>
(both runtime, for <command > git send-email</command> )
2012-02-27 00:56:20 +08:00
</para>
2016-03-19 09:08:52 +08:00
<bridgehead renderas= "sect4" > Optional (to create the man pages, html docs
and other docs)</bridgehead>
2016-12-03 23:27:21 +08:00
<para role= "optional" >
2014-07-19 01:51:38 +08:00
<xref linkend= "xmlto" /> and
2021-06-02 01:06:24 +08:00
<xref linkend= "asciidoc" />
<!-- or xref linkend="asciidoctor", doesn't work now because it needs docbook - xsl - ns --> ,
and also
2016-03-19 09:08:52 +08:00
<ulink url= "http://dblatex.sourceforge.net/" > dblatex</ulink>
(for the PDF version of the user manual), and
<ulink url= "http://docbook2x.sourceforge.net/" > docbook2x</ulink> to
create info pages
2012-02-27 00:56:20 +08:00
</para>
2012-02-15 21:45:35 +08:00
<para condition= "html" role= "usernotes" > User Notes:
2013-03-02 03:29:01 +08:00
<ulink url= "&blfs-wiki;/git" />
</para>
2012-02-15 21:45:35 +08:00
</sect2>
<sect2 role= "installation" >
<title > Installation of Git</title>
2013-03-02 03:29:01 +08:00
<para >
Install <application > Git</application> by running the following
commands:
</para>
2012-02-15 21:45:35 +08:00
2020-03-18 22:23:36 +08:00
<screen > <userinput > ./configure --prefix=/usr \
--with-gitconfig=/etc/gitconfig \
--with-python=python3 & &
2012-02-15 21:45:35 +08:00
make</userinput> </screen>
2014-08-17 07:39:09 +08:00
<para >
You can build the man pages and/or html docs, or
2020-11-04 05:07:09 +08:00
use downloaded ones. If you choose to build them, use the next two
2014-08-17 07:39:09 +08:00
instructions.
</para>
2013-03-02 03:29:01 +08:00
<para >
2016-04-17 07:52:17 +08:00
If you have installed <xref linkend= "asciidoc" /> you can
2013-03-02 03:29:01 +08:00
create the html version of the man pages and other docs:
</para>
2012-02-15 21:45:35 +08:00
2019-05-21 20:39:37 +08:00
<screen remap= "doc" > <userinput > make html</userinput> </screen>
2012-02-15 21:45:35 +08:00
2013-03-02 03:29:01 +08:00
<para >
2016-04-17 07:52:17 +08:00
If you have installed <xref linkend= "asciidoc" /> and
2013-03-02 03:29:01 +08:00
<xref linkend= "xmlto" /> you can create the man pages:
</para>
2012-02-24 07:53:00 +08:00
2019-05-21 20:39:37 +08:00
<screen remap= "doc" > <userinput > make man</userinput> </screen>
2012-02-24 07:53:00 +08:00
2013-03-02 03:29:01 +08:00
<para >
2016-03-19 09:08:52 +08:00
The test suite can be run in parallel mode. To run the test suite, issue:
<command > make test</command> . If run as a normal user, 0 tests should be
reported as failed in the final summary.
2013-03-02 03:29:01 +08:00
</para>
2012-02-15 21:45:35 +08:00
2013-03-02 03:29:01 +08:00
<para >
Now, as the <systemitem class= "username" > root</systemitem>
user:
</para>
2012-02-15 21:45:35 +08:00
2020-08-10 19:03:11 +08:00
<screen role= "root" > <userinput > make perllibdir=/usr/lib/perl5/&lfs-perl-version; /site_perl install</userinput> </screen>
2012-02-15 21:45:35 +08:00
2014-08-17 07:39:09 +08:00
<!-- ==== Method 1 for docs ====== -->
<bridgehead renderas= "sect3" > If you created the man pages and/or html docs</bridgehead>
2013-03-02 03:29:01 +08:00
<para >
2020-11-04 05:07:09 +08:00
Install the man pages as the
2013-03-02 03:29:01 +08:00
<systemitem class= "username" > root</systemitem> user:
</para>
2012-02-15 21:45:35 +08:00
2019-08-13 21:50:16 +08:00
<screen role= "root"
remap="doc"><userinput > make install-man</userinput> </screen>
2012-02-24 07:53:00 +08:00
2013-03-02 03:29:01 +08:00
<para >
2020-11-04 05:07:09 +08:00
Install the html docs as the
2013-03-02 03:29:01 +08:00
<systemitem class= "username" > root</systemitem> user:
</para>
2012-02-24 07:53:00 +08:00
2019-08-13 21:50:16 +08:00
<screen role= "root"
remap="doc"><userinput > make htmldir=/usr/share/doc/git-&git-version; install-html</userinput> </screen>
2014-08-17 07:39:09 +08:00
<!-- ==== Method 2 for docs ====== -->
<bridgehead renderas= "sect3" > If you downloaded the man pages and/or html docs</bridgehead>
2012-02-24 07:53:00 +08:00
2013-03-02 03:29:01 +08:00
<para >
2014-08-17 07:39:09 +08:00
If you downloaded the man pages untar them as the
2013-03-02 03:29:01 +08:00
<systemitem class= "username" > root</systemitem> user:
</para>
2012-02-24 07:53:00 +08:00
2014-08-29 19:34:30 +08:00
<screen role= "root" > <userinput > tar -xf ../git-manpages-&git-version; .tar.xz \
-C /usr/share/man --no-same-owner --no-overwrite-dir</userinput> </screen>
2012-02-24 07:53:00 +08:00
2013-03-02 03:29:01 +08:00
<para >
If you downloaded the html docs untar them as the
<systemitem class= "username" > root</systemitem> user:
</para>
2012-02-24 07:53:00 +08:00
2014-11-02 18:20:57 +08:00
<screen role= "root" > <userinput > mkdir -vp /usr/share/doc/git-&git-version; & &
tar -xf ../git-htmldocs-&git-version; .tar.xz \
-C /usr/share/doc/git-&git-version; --no-same-owner --no-overwrite-dir & &
2012-03-03 05:51:35 +08:00
2014-11-02 18:20:57 +08:00
find /usr/share/doc/git-&git-version; -type d -exec chmod 755 {} \; & &
find /usr/share/doc/git-&git-version; -type f -exec chmod 644 {} \;</userinput> </screen>
2013-08-25 10:16:08 +08:00
2014-08-17 07:39:09 +08:00
<!-- ==== Reorganize docs ====== -->
2016-03-19 09:08:52 +08:00
<bridgehead renderas= "sect3" > Reorganize text and html in the html-docs (both methods)</bridgehead>
2014-08-17 07:39:09 +08:00
<para >
2016-03-19 09:08:52 +08:00
For both methods, the html-docs include a lot of plain text files.
Reorganize the files as the
2014-08-17 07:39:09 +08:00
<systemitem class= "username" > root</systemitem> user:
</para>
2014-11-02 18:20:57 +08:00
<screen role= "root" > <userinput > mkdir -vp /usr/share/doc/git-&git-version; /man-pages/{html,text} & &
mv /usr/share/doc/git-&git-version; /{git*.txt,man-pages/text} & &
mv /usr/share/doc/git-&git-version; /{git*.,index.,man-pages/}html & &
2014-08-29 19:34:30 +08:00
2014-11-02 18:20:57 +08:00
mkdir -vp /usr/share/doc/git-&git-version; /technical/{html,text} & &
mv /usr/share/doc/git-&git-version; /technical/{*.txt,text} & &
mv /usr/share/doc/git-&git-version; /technical/{*.,}html & &
mkdir -vp /usr/share/doc/git-&git-version; /howto/{html,text} & &
mv /usr/share/doc/git-&git-version; /howto/{*.txt,text} & &
2017-06-11 05:05:09 +08:00
mv /usr/share/doc/git-&git-version; /howto/{*.,}html & &
2017-08-06 09:08:11 +08:00
sed -i '/^< a href=/s|howto/|& html/|' /usr/share/doc/git-&git-version; /howto-index.html & &
sed -i '/^\* link:/s|howto/|& html/|' /usr/share/doc/git-&git-version; /howto-index.txt</userinput> </screen>
2013-03-02 03:29:01 +08:00
2012-02-15 21:45:35 +08:00
</sect2>
<sect2 role= "commands" >
<title > Command Explanations</title>
2013-03-29 04:19:06 +08:00
<para >
2013-10-06 16:11:10 +08:00
<parameter > --with-gitconfig=/etc/gitconfig</parameter> : This sets
2013-03-29 04:19:06 +08:00
<filename > /etc/gitconfig</filename> as the file that stores
the default, system wide, <application > Git</application>
settings.
</para>
2013-03-02 03:29:01 +08:00
<para >
2021-03-10 12:19:17 +08:00
<parameter > --with-python=python3</parameter> : Use this switch to use
2020-03-18 22:23:36 +08:00
<application > Python 3</application> , instead of the EOL'ed
<application > Python 2</application> . Python is used for the
<command > git p4</command> interface to Perforce repositories,
and also used in some tests.
2013-03-02 03:29:01 +08:00
</para>
2012-02-24 07:53:00 +08:00
2013-03-02 03:29:01 +08:00
<para >
2017-08-06 09:08:11 +08:00
<option > --with-libpcre2</option> : Use this switch if
<application > PCRE2</application> is installed and has been built with
the non-default JIT enabled.
</para>
<para >
2017-09-24 20:34:59 +08:00
<option > --with-libpcre</option> : As an alternative to PCRE2, use this
2017-08-06 09:08:11 +08:00
switch if the deprecated <application > PCRE</application> is installed
and has been built with the non-default JIT enabled.
2013-03-02 03:29:01 +08:00
</para>
2012-03-03 05:51:35 +08:00
2013-03-02 03:29:01 +08:00
<para >
<command > tar -xf ../git-manpages-&git-version; .tar.gz -C
/usr/share/man --no-same-owner</command> : This untars
<filename > git-manpages-&git-version; .tar.gz</filename> . The
<option > -C</option> option makes tar change directory to
<filename class= "directory" > /usr/share/man</filename> before
it starts to decompress the docs. The <option > --no-same-owner</option>
option stops tar from preserving the user and group details of the
files. This is useful as that user or group may not exist on your
system; this could (potentially) be a security risk.
</para>
2012-03-03 05:51:35 +08:00
2013-03-02 03:29:01 +08:00
<para >
<command > mv /usr/share/doc/git-&git-version; ...</command> : These
commands move some of the files into subfolders to make it easier to sort
through the docs and find what you're looking for.
</para>
2012-02-24 07:53:00 +08:00
2013-08-25 10:16:08 +08:00
<para >
2015-07-29 01:09:57 +08:00
<command > find ... chmod ...</command> : These commands correct the
2013-08-25 10:16:08 +08:00
permissions in the shipped documentation tar file.
</para>
2012-02-15 21:45:35 +08:00
</sect2>
<sect2 role= "configuration" >
<title > Configuring Git</title>
<sect3 id= "git-config" >
<title > Config Files</title>
2013-03-02 03:29:01 +08:00
<para >
<filename > ~/.gitconfig</filename> and
<filename > /etc/gitconfig</filename>
</para>
2012-02-15 21:45:35 +08:00
<indexterm zone= "git git-config" >
<primary sortas= "e-AA.gitconfig" > ~/.gitconfig</primary>
</indexterm>
<indexterm zone= "git git-config" >
<primary sortas= "e-etc-gitconfig" > /etc/gitconfig</primary>
</indexterm>
2013-03-02 03:29:01 +08:00
2012-02-15 21:45:35 +08:00
</sect3>
</sect2>
<sect2 role= "content" >
<title > Contents</title>
<segmentedlist >
<segtitle > Installed Programs</segtitle>
2013-01-26 00:32:25 +08:00
<segtitle > Installed Libraries</segtitle>
2012-02-15 21:45:35 +08:00
<segtitle > Installed Directories</segtitle>
<seglistitem >
2013-03-02 03:29:01 +08:00
<seg >
2020-07-29 01:26:39 +08:00
git, git-receive-pack, git-upload-archive, and
git-upload-pack (hardlinked to each
other), git-cvsserver, git-shell, and gitk
2013-03-02 03:29:01 +08:00
</seg>
<seg >
None
</seg>
<seg >
2020-07-29 01:26:39 +08:00
/usr/libexec/git-core, and
2015-05-30 05:42:39 +08:00
/usr/share/{doc/git-&git-version; ,git-core,git-gui,gitk,gitweb}
2013-03-02 03:29:01 +08:00
</seg>
2012-02-15 21:45:35 +08:00
</seglistitem>
</segmentedlist>
<variablelist >
<bridgehead renderas= "sect3" > Short Descriptions</bridgehead>
<?dbfo list-presentation="list"?>
<?dbhtml list-presentation="table"?>
<varlistentry id= "git-prog" >
<term > <command > git</command> </term>
<listitem >
2013-03-02 03:29:01 +08:00
<para >
2021-02-19 23:20:16 +08:00
is the stupid content tracker
2013-03-02 03:29:01 +08:00
</para>
2012-02-15 21:45:35 +08:00
<indexterm zone= "git git-prog" >
<primary sortas= "b-git" > git</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id= "git-cvsserver" >
<term > <command > git-cvsserver</command> </term>
<listitem >
2013-03-02 03:29:01 +08:00
<para >
2021-02-19 23:20:16 +08:00
is a CVS server emulator for <application > Git</application>
2013-03-02 03:29:01 +08:00
</para>
2012-02-15 21:45:35 +08:00
<indexterm zone= "git git-cvsserver" >
<primary sortas= "b-git-cvsserver" > git-cvsserver</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id= "gitk" >
<term > <command > gitk</command> </term>
<listitem >
2013-03-02 03:29:01 +08:00
<para >
2014-01-27 12:37:49 +08:00
is a graphical <application > Git</application> repository browser
2021-02-19 23:20:16 +08:00
(needs <xref linkend= "tk" /> )
2013-03-02 03:29:01 +08:00
</para>
2012-02-15 21:45:35 +08:00
<indexterm zone= "git gitk" >
<primary sortas= "b-gitk" > gitk</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id= "git-receive-pack" >
<term > <command > git-receive-pack</command> </term>
<listitem >
2013-03-02 03:29:01 +08:00
<para >
is invoked by <command > git send-pack</command> and updates the
2021-02-19 23:20:16 +08:00
repository with the information fed from the remote end
2013-03-02 03:29:01 +08:00
</para>
2012-02-15 21:45:35 +08:00
<indexterm zone= "git git-receive-pack" >
<primary sortas= "b-git-receive-pack" > git-receive-pack</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id= "git-shell" >
<term > <command > git-shell</command> </term>
<listitem >
2013-03-02 03:29:01 +08:00
<para >
is a login shell for SSH accounts to provide restricted Git
2021-02-19 23:20:16 +08:00
access
2013-03-02 03:29:01 +08:00
</para>
2012-02-15 21:45:35 +08:00
<indexterm zone= "git git-shell" >
<primary sortas= "b-git-shell" > git-shell</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id= "git-upload-archive" >
<term > <command > git-upload-archive</command> </term>
<listitem >
2013-03-02 03:29:01 +08:00
<para >
is invoked by <command > git archive --remote</command> and sends
2021-02-19 23:20:16 +08:00
a generated archive to the other end over the git protocol
2013-03-02 03:29:01 +08:00
</para>
2012-02-15 21:45:35 +08:00
<indexterm zone= "git git-upload-archive" >
<primary sortas= "b-git-upload-archive" > git-upload-archive</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id= "git-upload-pack" >
<term > <command > git-upload-pack</command> </term>
<listitem >
2013-03-02 03:29:01 +08:00
<para >
is invoked by <command > git fetch-pack</command> , it discovers
what objects the other side is missing, and sends them after
2021-02-19 23:20:16 +08:00
packing
2013-03-02 03:29:01 +08:00
</para>
2012-02-15 21:45:35 +08:00
<indexterm zone= "git git-upload-pack" >
<primary sortas= "b-git-upload-pack" > git-upload-pack</primary>
</indexterm>
</listitem>
</varlistentry>
2013-03-02 03:29:01 +08:00
2012-02-15 21:45:35 +08:00
</variablelist>
2013-03-02 03:29:01 +08:00
2012-02-15 21:45:35 +08:00
</sect2>
2013-03-02 03:29:01 +08:00
2012-02-15 21:45:35 +08:00
</sect1>