Advanced Site Tools
How to install GIT on Linux and MAC OS?

How to install GIT on Linux and MAC OS?

How to install GIT on Linux?

On Linux you can compile the GIT system from source or use the following commands:

apt-get install git-core

for Ubuntu/Debian or:

yum install git-core

for Fedora/CentOS.

You’ll be asked to confirm the download and installation; simply enter y to confirm. Once this command is complete, git will be installed and ready to use!

How to install GIT on MAC?

The easiest way to install Git on a Mac is via the stand-alone installer, which you can download from here. Open the newly downloaded file an follow the prompts to perform the installation.

To confirm the GIT installation is correct, open a new Terminal window and type in the following command:

git --version

If GIT is installed, the above command should output the current version installed.

Configuring GIT before first use

Before you start using GIT, you should configure your username and email. These details will be associated with any commits that you create. To perform the configuration, run the following commands:

git config --global user.name "your_username"
git config --global user.email "email@yourdomainname.com"

Replace your_username and email@yourdomainname.com with your actual username and email address.

Share This Article