%general-entities; ]> Git-&git-version; Git 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, Bazaar, Subversion, CVS, Perforce, and Team Foundation Server. &lfs121_checked; Download (HTTP): Download (FTP): Additional Downloads &git-root;/git-manpages-&git-version;.tar.xz &git-root;/git-htmldocs-&git-version;.tar.xz and other docs Git Dependencies Recommended (needed to use Git over http, https, ftp or ftps) Installation of Git Install Git by running the following commands: ./configure --prefix=/usr \ --with-gitconfig=/etc/gitconfig \ --with-python=python3 && make The test suite can be run in parallel mode. To run the test suite, issue: make test -k |& tee test.log. If some test fails, the list of failed tests can be shown via grep '^not ok' test.log | grep -v TODO. Now, as the root user: make perllibdir=/usr/lib/perl5/&lfs-perl-version;/site_perl install 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-&git-version;.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-&git-version; && tar -xf ../git-htmldocs-&git-version;.tar.xz \ -C /usr/share/doc/git-&git-version; --no-same-owner --no-overwrite-dir && find /usr/share/doc/git-&git-version; -type d -exec chmod 755 {} \; && find /usr/share/doc/git-&git-version; -type f -exec chmod 644 {} \; Reorganize text and html in the html-docs The html-docs include a lot of plain text files. Reorganize the files as the root user: 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 && 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} && mv /usr/share/doc/git-&git-version;/howto/{*.,}html && 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 Using Git This Git installation doesn't have the full power Git can provide, such as scheduling and the like. If you want even more features, check . However, this installation if you installed can provide enough features to be of good use for you, such as the ability to clone repos. This is sometimes a necessity when developers don't publish releases or haven't in a long time, so the repo is the only way to obtain the (hopefully) up to date package. In order to clone a repo, simply invoke: git clone https://path/to/repo.git The above command will then clone the entire repository besides subprojects, something that some projects do and require special instructions. A directory will be created, called repo, in the current working directory, with all the repo's files being in that just created directory. If you want to for some reason change the directory name, you can do it when you clone the repo, like so: git clone https://path/to/repo.git newname The above command will create the directory called newname and put all the repo's files in that directory. Eventually you'll come across a repository that has some subprojects, for instance an emulator that depends on graphic libraries and intends to compile a static version of it. In order to pull in those subprojects, you must also invoke the --recurse-submodules option. This will clone all the subprojects and check them out. Git Repo vs Release Archives All of the packages in GLFS, except for when obtaing firmware, have you download tarballs or zipfiles. These tarballs and zipfiles were created as part of a release, and often include files not found in the repo equivalent where the package development happens. Usually the extra included files are the configure scripts you should now be used to using. They are generated manually using aclocal, autoconf , and automake. The configure scripts are often not in the repos, so if the git repo gets cloned, you will have to generate the configure script yourself if you find configure.ac, Makefile.am, and possibly autogen.sh . You won't need to do this if you find the repo has a Makefile or has meson_options.txt or CMakeLists.txt. Another big difference between the repo and the release package is that the repo probably has had commits after the last release if it had any, and new commits can introduce bugs or prevent compilation. When developers prepare a new release, often they search for issues, bugs, and compilation errors, making it stable before they publish the release and its related package files. Release packages aren't entirely safe from issues and can help with causing issues as files can be added. Sometimes you can tell if something is wrong, sometimes you can't. It's always important to be up to date with security news to prevent damage. Command Explanations --with-gitconfig=/etc/gitconfig: This sets /etc/gitconfig as the file that stores the default, system wide, Git settings. --with-python=python3: Use this switch to use Python 3, instead of the EOL'ed Python 2. Python is used for the git p4 interface to Perforce repositories, and also used in some tests. : Use this switch if PCRE2 is installed. tar -xf ../git-manpages-&git-version;.tar.gz -C /usr/share/man --no-same-owner: This untars git-manpages-&git-version;.tar.gz. The option makes tar change directory to /usr/share/man before it starts to decompress the docs. The 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-&git-version; ...: 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. Configuring Git Config Files ~/.gitconfig and /etc/gitconfig ~/.gitconfig /etc/gitconfig Contents Installed Programs Installed Libraries Installed Directories git, git-receive-pack, git-upload-archive, and git-upload-pack (hardlinked to each other), git-cvsserver, git-shell, gitk, and scalar None /usr/libexec/git-core, /usr/lib/perl5/&lfs-perl-version;/site_perl/Git, and /usr/share/{doc/git-&git-version;,git-core,git-gui,gitk,gitweb} Short Descriptions git is the stupid content tracker git git-cvsserver is a CVS server emulator for Git git-cvsserver gitk is a graphical Git repository browser (needs Tk) gitk git-receive-pack is invoked by git send-pack and updates the repository with the information fed from the remote end git-receive-pack git-shell is a login shell for SSH accounts to provide restricted Git access git-shell git-upload-archive is invoked by git archive --remote and sends a generated archive to the other end over the git protocol git-upload-archive git-upload-pack is invoked by git fetch-pack, it discovers what objects the other side is missing, and sends them after packing git-upload-pack scalar is a repository management tool that optimizes Git for use in large repositories scalar