Jump to content

Git installation and configuration

Recommended Posts


Git - software that allows track changes, restore previous versions and create alternative file and folder versions on your OS. It is one of the most popular such kind of systems that allows using Git repositories for project management.


In this guide, you will see how to install and configure Git in Ubuntu 18.04 OS template.

0. Requirements:

Linux server with Ubuntu 18.04 OS template installed.

1. Installation:

As recommended during all installations, firstly we should update the server repositories:
sudo apt-get update
When the update will be completed, install git:
sudo apt-get install git -y
You can check what version was installed via using:
git --version

At the moment of writing this guide, the version should be shown as:

git version 2.17.1
When the installation is completed and you have checked the version, you can skip to 3rd step.

2. Git Configuration.

When Git is installed, it's time to configure it, so that generated messages would have the correct information.
Required information can be saved using git --config command. In the following example, we will set a username and e-mail address, since Git uses this information in every message. This information can be added by following these commands:
git config --global user.name "your_username"
git config --global user.email "your_email"

To check what was saved, use:

git config --list
The result of this command should look like this:
root@VPS:~# git config --list
This information is being saved in Git configuration file, that you can adjust manually if needed by any text editor:
nano ~/.gitconfig
The command should show you this result:
  name = your_username
  email = your_email
There are lots of options that you can set up with your Git configuration. However, the username and e-mail are mandatory for using Git successfully. If this step will be skipped, you will receive warnings from trying using Git.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...