Introduction to Git
Git 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
Git clone is a full-fledged
repository with 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. Git is used for version control of files, much
like tools such as Mercurial-3.7.1, Bazaar, Subversion-1.9.3, CVS, Perforce, and Team
Foundation Server.
This package is known to build and work properly using an LFS-7.9
platform.
Package Information
Additional Downloads
Git Dependencies
Recommended
cURL-7.47.1 (needed to use Git over http, https, ftp or ftps), OpenSSL-1.0.2g, and Python-2.7.11
Optional
PCRE-8.38,
Subversion-1.9.3 with Perl bindings (for
git svn), Tk-8.6.4 (gitk, a simple
Git repository viewer, uses
Tk at runtime), and Valgrind-3.11.0
Optional (to create the man pages and html docs)
xmlto-0.0.28 and AsciiDoc or AsciiDoctor
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/git
Installation of Git
Install Git by running the
following commands:
./configure --prefix=/usr --with-gitconfig=/etc/gitconfig &&
make
You can build the man pages and/or html docs, or use downloaded
ones. If you choose to build them, use next two following
instructions.
If you have installed AsciiDoc you can create
the html version of the man pages and other docs:
make html
If you have installed AsciiDoc and xmlto-0.0.28 you can create the man pages:
make man
The test suite fails early, in 'blame respects encoding', because
grep-2.23 treats data in the locale tests as binary. To run the
tests up to that point issue: make
test. -->
Now, as the root
user:
make install
If you created the man pages and/or html docs
Install the man pages as root
user:
make install-man
Install the html docs as root
user:
make htmldir=/usr/share/doc/git-2.7.1 install-html
If you downloaded the man pages and/or html docs
If you downloaded the man pages untar them as the root
user:
tar -xf ../git-manpages-2.7.1.tar.xz \
-C /usr/share/man --no-same-owner --no-overwrite-dir
If you downloaded the html docs untar them as the root
user:
mkdir -vp /usr/share/doc/git-2.7.1 &&
tar -xf ../git-htmldocs-2.7.1.tar.xz \
-C /usr/share/doc/git-2.7.1 --no-same-owner --no-overwrite-dir &&
find /usr/share/doc/git-2.7.1 -type d -exec chmod 755 {} \; &&
find /usr/share/doc/git-2.7.1 -type f -exec chmod 644 {} \;
Reorganize man pages and/or html docs (both methods)
For both methods, reorganize the files, as root
user:
mkdir -vp /usr/share/doc/git-2.7.1/man-pages/{html,text} &&
mv /usr/share/doc/git-2.7.1/{git*.txt,man-pages/text} &&
mv /usr/share/doc/git-2.7.1/{git*.,index.,man-pages/}html &&
mkdir -vp /usr/share/doc/git-2.7.1/technical/{html,text} &&
mv /usr/share/doc/git-2.7.1/technical/{*.txt,text} &&
mv /usr/share/doc/git-2.7.1/technical/{*.,}html &&
mkdir -vp /usr/share/doc/git-2.7.1/howto/{html,text} &&
mv /usr/share/doc/git-2.7.1/howto/{*.txt,text} &&
mv /usr/share/doc/git-2.7.1/howto/{*.,}html
Command Explanations
--with-gitconfig=/etc/gitconfig
: This
sets /etc/gitconfig
as the file that
stores the default, system wide, Git settings.
--without-python
: Use this switch if
Python is not installed.
--with-libpcre
: Use this switch if
PCRE is installed.
tar -xf ../git-manpages-2.7.1.tar.gz
-C /usr/share/man --no-same-owner: This untars
git-manpages-2.7.1.tar.gz
. The
-C
option makes tar change directory to
/usr/share/man
before it starts to
decompress the docs. The --no-same-owner
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.
mv /usr/share/doc/git-2.7.1
...: 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.
find ... chmod ...:
These commands correct the permissions in the shipped documentation
tar file.