We’ll show you, How To Install Git on CentOS 7<\/strong>. Git is a distributed version control system, which you can use to track the code changes (versions) while developing software. Git offers features such as reverting to a previous stage, multiple workflows, local branching, and many others. This makes Git one of the best version control systems and that is why it is used by many software developers. Installing Git on CentOS <\/strong>7 is an easy task, just carefully follow the steps below, and you should have it installed in less than 10 minutes.<\/p>\n
<\/p>\n
Table of Contents<\/p>\n
To install Git on your CentOS 7 VPS<\/a> you need to have SSH access to the server. If you don’t know how to do this, you can follow our guide on how to connect to a Linux server via SSH<\/a>.<\/p>\n
Once you log in you can use the following command to install Git:<\/p>\n
yum install git<\/pre>\n<\/span>3. Verify Git installation on CentOS 7<\/span><\/h2>\n
To verify that Git is successfully installed you can use the following command:<\/p>\n
git --version<\/pre>\nThe command above will also show the version of Git installed on your CentOS 7 VPS<\/a>.<\/p>\n
# git --version\r\ngit version 1.8.3.1<\/pre>\n<\/span>4. The configuration of Git on CentOS 7<\/span><\/h2>\n
The first thing that you might want to do after the installation is to configure your name and email address in Git so the changes you commit contain the correct information. You can do that by using the following commands:<\/p>\n
git config --global user.name \"Your Name\"\r\ngit config --global user.email \"user@domain.com\"\r\n<\/pre>\n<\/span>5. List configuration settings<\/span><\/h2>\n
To verify that you entered the correct information you can use the command below:<\/p>\n
git config --list<\/pre>\nThe output should be similar to the following one:<\/p>\n
# git config --list\r\nuser.name=Your Name\r\nuser.email=user@domain.com<\/pre>\n<\/span>6. Git command line option and help<\/span><\/h2>\n
For more information and command line options you can use the
--help<\/code> flag.<\/p>\n
git --help<\/pre>\n
It will list the most commonly used Git commands.<\/p>\n
add Add file contents to the index\r\n bisect Find by binary search the change that introduced a bug\r\n branch List, create, or delete branches\r\n checkout Checkout a branch or paths to the working tree\r\n clone Clone a repository into a new directory\r\n commit Record changes to the repository\r\n diff Show changes between commits, commit and working tree, etc\r\n fetch Download objects and refs from another repository\r\n grep Print lines matching a pattern\r\n init Create an empty Git repository or reinitialize an existing one\r\n log Show commit logs\r\n merge Join two or more development histories together\r\n mv Move or rename a file, a directory, or a symlink\r\n pull Fetch from and merge with another repository or a local branch\r\n push Update remote refs along with associated objects\r\n rebase Forward-port local commits to the updated upstream head\r\n reset Reset current HEAD to the specified state\r\n rm Remove files from the working tree and from the index\r\n show Show various types of objects\r\n status Show the working tree status\r\n tag Create, list, delete or verify a tag object signed with GPG\r\n<\/pre>\nYou can also refer to the Git documentation<\/a>.<\/p>\n
\n
Of course, you don\u2019t have to install Git on CentOS<\/strong> 7, if you use one of our Git Hosting<\/a> services, in which case you can simply ask our expert Linux admins to install Git on CentOS 7 for you. They are available 24\u00d77 and they will install Git on CentOS 7, immediately.<\/p>\n