Git is a popular, free Version Control System, designed for use by software developers. The essence of Version Control is the ability to capture the state of software documents, and in doing so make it possible to revert to a previous state if required.
In this tutorial, we’ll show you the step by step instructions to install Git on Ubuntu Linux.
The first step is to download and install Git. Git is entirely free, and can run on machines using Windows, Mac and Linux operating systems. Based on your operating system, the specific process to install Git will vary slightly.
So open a command line terminal and enter apt update, and press the Enter key. If there are updates, you’ll see an output similar to below screen:
To install Git, run the following command:
Command: apt install git
To confirm the git installation, you can use the following command for checking the git version:
Command: git –version
So now you have your command line open, it’s time to begin using Git. However, before Git will allow you to interact with it on any project, you must set up two very simple configuration options:
You will identify yourself within Git by adding your name and an email address. Set your global user name and email by using the below commands:
Command: git config –global user.name “Tech Hyme”
Command: git config –global user.email “firstname.lastname@example.org”
Once you’ve entered the required commands, you’ll need to press Enter to run them.
Alternatively, you can also set your configuration directly by editing the ~/.gitconfig file:
name = Tech Hyme
email = email@example.com
You can also confirm your git configurations with the help of –list attribute
Command: git config –list
Once you’re done, save your project. Now let’s return to the command line tool and tell Git to start tracking the history of this new file.
Command: git add yourproject.txt
Don’t expect any feedback at this stage. Git has happily accepted your command and executed it instantly. Git now knows that you are going to track the progress of this file.
Let’s capture the current state of this file for all time by performing our first commit.
Command: git commit -am “Initial Commit”
A commit has at least two parts: the file(s) to be included and a commit “message.”
The message is just a handy label (one or more tags, a description, or whatever) that we add to help us when searching through a long list of commits in the history.
Furthermore, if you want to see the entire history of your project, and locate a particular point to check out, simply issue the following command:
Command: git log
You may also read:
- [Ubuntu] Installation and Configuration of XRDP
- 5 Ways You Can Find Your MAC Address in Ubuntu
- Four Ways To List all Disk Partitions in Ubuntu
- [Linux] Enable Remote Access to phpMyAdmin – XAMPP/LAMPP
- 4 Easy Steps To Secure Your Kali Linux Operating System
- How To Install Palo Alto GlobalProtect VPN in Windows
- Fix Ubuntu 404 Not Found Error in Ubuntu apt-get update Command
- [Windows 10] How To Enable News and Weather Widget with Regedit and GPEDIT
- [Windows 10] Find Hard Drive Serial Number with CMD
- Convert WOFF to TTF File (Online Tool/Python)