Skip to content

Instantly share code, notes, and snippets.

@egorsmkv
Last active May 5, 2023 04:19
Show Gist options
  • Save egorsmkv/30faa3e61c185a41e89cf849737d4d4b to your computer and use it in GitHub Desktop.
Save egorsmkv/30faa3e61c185a41e89cf849737d4d4b to your computer and use it in GitHub Desktop.
Build git from source code on CentOS 7

Build git from source code

1) Go to https://git-scm.com/ and check out the latest version of Git

Currently, the latest version is 2.18.0. Download and extract it and go to the folder of the source code:

wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.18.0.tar.gz
tar xf git-2.18.0.tar.gz
cd git-2.18.0/

2) Install the dependencies

yum groupinstall 'Development Tools'
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-CPAN perl-devel

3) Configure

make configure
./configure --prefix=/usr/local

4) Compile

make all

5) Install

make install
@gameboydathird
Copy link

i dont get it

@egorsmkv
Copy link
Author

egorsmkv commented Mar 2, 2023

i dont get it

it happens

just learn more

@wirelessben
Copy link

wirelessben commented Apr 15, 2023

i dont get it

Don't use this gist. It has errors, and the author's response was not helpful. Use this one.
Find out what the latest version of git is at https://git-scm.com/, say 2.40.0. Replace 2.31.1 in the first line with 2.40.0.
Start a terminal application. (On a mac, Lauchpad -> Terminal)
Copy, paste, and enter all these commands in the terminal, one after another. ( The make command will take many minutes.)
"sudo make install" will put the compiled program in directory /usr/local/bin.
You can then run the git command from the terminal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment