Any developer needs Git for version control to help manage and track new versions of your project. As a decentralized version control system, Git is useful in many ways. For example, you can clone projects, share projects, make changes, collaborate with other developers, etc. To use Git, you need to install it on your system, add the necessary configuration details, and start using the “git” command to complete your tasks. For Linux Mint users, this post guides you on the simplest way to install Git. To keep an eye!
How to Install Git on Linux Mint
One of the beauties of Git is that it's free and cross-platform. Thus, you can use it whenever you are ready and on any platform. We have explained in detail the steps you should follow.
Step 1: Update Your Linux Mint Repository
When installing any package, it is best to get the latest version from the Linux Mint repository. Thus, start by refreshing “apt” with the following command:
Once you've confirmed that all packages are updated, quickly check to make sure Git is not installed on your system. “git-version” command will work.
Step 2: Install Git Package
Linux Mint supports Git and you can install it from the Linux Mint official repository. Use the following command and let it run until it completes:
, sudo apart to install git -y
Depending on your internet speed, the installation should be quick, and you will get an output confirming that Git installed successfully. Proceed to confirm this by checking the installed version. In our case, we installed Git version 2.34.1 as shown in the following:
That’s it. Now Git is installed on your Linux Mint. From here, the next step should be to configure Git to allow you to start working on your projects.
Simple Git configuration in Linux Mint
You will need to configure a Git account to use it on your Linux Mint terminal. For that, you need to set up a username and an email. For example, you can use the same email on your GitHub account to allow a seamless connection between Git and GitHub while working and progressing your project.
To configure a username for your account, use the following syntax:
, git config –global User name <User name,
Here, we set our username to “linuxhint-git”.
You only need to set up email for the new account. Use the following syntax:
, git config –global User name <E-mail,
Once you've set up your account details, Git allows you to display user information. For that, you should use the following command:
Notice how the information we configured earlier is displayed on the terminal, confirming that our new account is set up properly.
Additionally, we need to create a workspace where all your Git projects will be installed. This workspace is your project's directory, and you initialize it before you start executing “git” commands.
We use the “mkdir” command to create /gitproject.
Next, let's initialize the Git repository using the “git init” command and specify the repository of the target project which is the newly created workspace directory.
You will get an output similar to the following, and the last line in the output will confirm that your repository has started successfully.
With this, you can use the “git” command and work on your project. For example, you can clone a repository, start a project, or push a commit. See the “git” command to access your newly initialized Git repository.
Git is undoubtedly a useful version control system. Knowing how to use it properly simplifies your activities as a developer, and its benefits are innumerable. In Linux Mint, you can follow the detailed steps given in this guide to install Git. Plus, we covered how to set up a new account and start your first Git repository.