Home » Git: Install GitHub on Linux – CentOS 7

Git: Install GitHub on Linux – CentOS 7

by Pring
Git: Install GitHub on Linux - CentOS 7

I. Introduction.

This tutorial will teaches you how to install GitHub on Linux – CentOS 7 server. Software version control systems enable you to keep track of your software at the source level. With versioning tools, you can track changes, revert to previous stages, and branch to create alternate versions of files and directories. Git is one of the most popular version control system currently available.

II. Prerequisites.

1. Login to your system via SSH. You can use PuTTy tool or Poderosa tool,…
2. Login with root user.  If you are logged in as another user, you will need to add sudo before each command.

III. How to install GitHub on Linux – CentOS 7 step by step.

To install Git on Linux – CentOS 7, the two most common way s to install Git will be described in this section.

Option 1: Install Git using Yum, follow these steps:
Step 1. Install GitHub.
Step 2. Verify the installation.


Option 2: Install Git from Source, follow these steps:
Step 1. Install the software that git depends on.
Step 2. Download GitHub source.
Step 3. Install GitHub.
Step 4. Verify the installation.

You can see details of Video on how to install GitHub on Linux – CentOS 7 as below.
[Sorry, the video we will update later]

Or you also can see details as below.

Option 1: Install GitHub with Yum.

Step 1. Install GitHub.

Enter the command below.

sudo yum install git

Sample Output:

[root@devopsio ~]# sudo yum install git
Resolving Dependencies
--> Running transaction check
---> Package git.x86_64 0:1.8.3.1-20.el7 will be installed
--> Processing Dependency: perl-Git = 1.8.3.1-20.el7 for package: git-1.8.3.1-20.el7.x86_64
--> Processing Dependency: perl(Git) for package: git-1.8.3.1-20.el7.x86_64
--> Running transaction check
---> Package perl-Git.noarch 0:1.8.3.1-20.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================
 Package              Arch               Version                     Repository           Size
===============================================================================================
Installing:
 git                  x86_64             1.8.3.1-20.el7              updates             4.4 M
Installing for dependencies:
 perl-Git             noarch             1.8.3.1-20.el7              updates              55 k

Transaction Summary
===============================================================================================
Install  1 Package (+1 Dependent package)

Total download size: 4.4 M
Installed size: 22 M
Is this ok [y/d/N]: y
Downloading packages:
(1/2): perl-Git-1.8.3.1-20.el7.noarch.rpm                               |  55 kB  00:00:00     
(2/2): git-1.8.3.1-20.el7.x86_64.rpm                                    | 4.4 MB  00:00:00     
-----------------------------------------------------------------------------------------------
Total                                                           12 MB/s | 4.4 MB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : git-1.8.3.1-20.el7.x86_64                                                   1/2 
  Installing : perl-Git-1.8.3.1-20.el7.noarch                                              2/2 
  Verifying  : perl-Git-1.8.3.1-20.el7.noarch                                              1/2 
  Verifying  : git-1.8.3.1-20.el7.x86_64                                                   2/2 

Installed:
  git.x86_64 0:1.8.3.1-20.el7                                                                  

Dependency Installed:
  perl-Git.noarch 0:1.8.3.1-20.el7                                                             

Complete!

Step 2. Verify the installation.

Enter the command below.

git –version

Sample Output:

[root@devopsio ~]# git --version
git version 1.8.3.1

Option 2: Install GitHub from Source.

Step 1. Install the software that git depends on.

Enter the command below.

sudo yum groupinstall “Development Tools”
sudo yum install gettext-devel openssl-devel perl-CPAN perl-devel zlib-devel

Step 2. Download GitHub source.

Access the project’s releases page on GitHub.
Choose the version you want –> Copy link

Git: Install GitHub on Linux - CentOS 7

Now we are going to use the wget command in our CentOS server to download the source archive from the link that we copied, and renaming it to [ git-2.22.1.tar.gz ]
Enter the command below.

cd /tmp
wget https://github.com/git/git/archive/v2.22.1.tar.gz -O git-2.22.1.tar.gz /tmp

Sample Output:

[root@devopsio tmp]# wget https://github.com/git/git/archive/v2.22.1.tar.gz -O git-2.22.1.tar.gz /tmp
--2019-08-13 16:24:00--  https://github.com/git/git/archive/v2.22.1.tar.gz
Resolving github.com (github.com)... 13.250.177.223
Connecting to github.com (github.com)|13.250.177.223|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/git/git/tar.gz/v2.22.1 [following]
--2019-08-13 16:24:00--  https://codeload.github.com/git/git/tar.gz/v2.22.1
Resolving codeload.github.com (codeload.github.com)... 13.229.189.0
Connecting to codeload.github.com (codeload.github.com)|13.229.189.0|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8486778 (8.1M) [application/x-gzip]
Saving to: ‘git-2.22.1.tar.gz’

100%[=====================================================>] 8,486,778   4.48MB/s   in 1.8s   

2019-08-13 16:24:03 (4.48 MB/s) - ‘git-2.22.1.tar.gz’ saved [8486778/8486778]

/tmp: Scheme missing.
FINISHED --2019-08-13 16:24:03--
Total wall clock time: 3.3s
Downloaded: 1 files, 8.1M in 1.8s (4.48 MB/s)

When the download is completed, extract [ git-2.22.1.tar.gz ] file into the [ /opt ] directory:

sudo tar xf /tmp/git-2.22.1.tar.gz -C /opt
ls -lrt /opt

Step 3. Install GitHub.

We can check for everything that we need with the configure script that is generated by make configure.
Enter the command below.

cd /opt/git-2.22.1
make configure
./configure –prefix=/usr/local

Sample Output:

[root@devopsio git-2.22.1]# make configure
    GEN configure
[root@devopsio git-2.22.1]# ./configure --prefix=/usr/local
configure: Setting lib to 'lib' (the default)
configure: Will try -pthread then -lpthread to enable POSIX Threads.
configure: CHECKS for site configuration
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
configure: CHECKS for programs
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking for inline... inline
checking if linker supports -R... no
checking if linker supports -Wl,-rpath,... yes
checking for gar... no
checking for ar... ar
checking for gtar... gtar
checking for gnudiff... no
checking for gdiff... no
checking for diff... diff
checking for asciidoc... no
Using 'grep -a' for sane_grep
configure: CHECKS for libraries
checking for SHA1_Init in -lcrypto... yes
checking for curl_global_init in -lcurl... no
checking for XML_ParserCreate in -lexpat... no
checking for iconv in -lc... yes
checking for deflateBound in -lz... yes
checking for socket in -lc... yes
checking for inet_ntop... yes
checking for inet_pton... yes
checking for hstrerror... yes
checking for basename in -lc... yes
checking if libc contains libintl... yes
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
configure: CHECKS for header files
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking poll.h usability... yes
checking poll.h presence... yes
checking for poll.h... yes
checking sys/poll.h usability... yes
checking sys/poll.h presence... yes
checking for sys/poll.h... yes
checking for inttypes.h... (cached) yes
checking for old iconv()... no
configure: CHECKS for typedefs, structures, and compiler characteristics
checking for socklen_t... yes
checking for struct itimerval... yes
checking for struct stat.st_mtimespec.tv_nsec... no
checking for struct stat.st_mtim.tv_nsec... yes
checking for struct dirent.d_type... yes
checking for struct passwd.pw_gecos... yes
checking for struct sockaddr_storage... yes
checking for struct addrinfo... yes
checking for getaddrinfo... yes
checking for library containing getaddrinfo... none required
checking whether the platform regex supports REG_STARTEND... yes
checking whether system succeeds to read fopen'ed directory... yes
checking whether snprintf() and/or vsnprintf() return bogus value... no
checking whether the platform uses typical file type bits... yes
configure: CHECKS for library functions
checking libgen.h usability... yes
checking libgen.h presence... yes
checking for libgen.h... yes
checking paths.h usability... yes
checking paths.h presence... yes
checking for paths.h... yes
checking libcharset.h usability... no
checking libcharset.h presence... no
checking for libcharset.h... no
checking for strings.h... (cached) yes
checking for locale_charset in -liconv... no
checking for locale_charset in -lcharset... no
checking for clock_gettime... yes
checking for library containing clock_gettime... none required
checking for CLOCK_MONOTONIC... yes
checking for setitimer... yes
checking for library containing setitimer... none required
checking for strcasestr... yes
checking for library containing strcasestr... none required
checking for memmem... yes
checking for library containing memmem... none required
checking for strlcpy... no
checking for uintmax_t... yes
checking for strtoumax... yes
checking for library containing strtoumax... none required
checking for setenv... yes
checking for library containing setenv... none required
checking for unsetenv... yes
checking for library containing unsetenv... none required
checking for mkdtemp... yes
checking for library containing mkdtemp... none required
checking for initgroups... yes
checking for library containing initgroups... none required
checking for getdelim... yes
checking for library containing getdelim... none required
checking for BSD sysctl... no
checking for POSIX Threads with ''... no
checking for POSIX Threads with '-mt'... no
checking for POSIX Threads with '-pthread'... yes
configure: creating ./config.status
config.status: creating config.mak.autogen
config.status: executing config.mak.autogen commands

After call make configure then install Git.
Enter the comand below.

sudo make install

Step 4. Verify the installation.

To verify that GitHub is installed, use the git -version command which will print the Git version:
Enter the command below.

git –version

IV. Conclusion.

In this tutorial, we was Install GitHub on Linux – CentOS 7 server. If you hit a problem or have feedback, leave a comment below.
You can now visit the official GitHub Documentation page and learn how to get started with Git.


Install GitHub on Linux – CentOS 7 is complete. Wish you success and luck.
Thanks and best regards!
— Pring —

Related Articles

6 comments

vurtilopmer December 11, 2019 - 4:07 pm

Some really nice and useful information on this web site, too I think the design holds superb features.

Reply
alcohol rehab nea rme February 27, 2020 - 2:29 pm

I think this is among the most significant info
for me. And i am glad reading your article. But should remark on few general things,
The web site style is wonderful, the articles is really great : D.
Good job, cheers

Reply
Alcohol Rehab Near Me March 28, 2020 - 5:05 am

Hi!
My name is Kathi and I’m a 23 years old girl from Zevenbergen. http://aaa-rehab.com

Reply
바카라 October 15, 2020 - 4:43 pm

Post writing is also a fun, if you know then you can write or else it is difficult to
write.

Reply
에비앙카지노 October 16, 2020 - 6:58 am

It’s appropriate time to make some plans for the long run and it
is time to be happy. I have read this post and if
I could I wish to recommend you few fascinating issues or advice.

Perhaps you can write next articles relating to this article.
I desire to read more things approximately it!

Reply
ryidlnrwqb November 12, 2020 - 1:37 am

Muchas gracias. ?Como puedo iniciar sesion?

Reply

Leave a Comment