Two ways to skin the cat
There are two ways to install git:
- Package Manager
- From source (Not covered here at this time.)
How to install git using yum
git is available from most yum-based distro's default repositories.
To see if git is available for installation, try this:
[user@server ~]$ yum list git
Available Packages
git.x86_64 1.7.1-3.el6_4.1
Install the git package with:
sudo yum install git
You will be prompted to accept the installation. Type 'y' when prompted.
To verify that git was installed correctly, check the version number of the git installation.
[user@server ~]$ git --version
git version 1.7.1
How to set up git
Commits performed in git, embeds your name and email address into the commit message.
This allows git to track users and their changes.
The default for git, is to try to guess the user that is submitting changes. If you do not specificaly provide them, git will use the username and hostname of the system to create these entries for you. By setting your user up now, you will prevent error messages that force you to revise commits after submission.
Here is who to set the values you wish to use for your user:
git config --global user.name "Your Name Here"
git config --global user.email "your_email@example.com"
The configuration changes will be stored in a file in your home directory.
~/.gitconfig
You can see them with a normal text editor:
vim ~/.gitconfig