Installing and configuring git in your system

Hi, I am data engineer from Nepal with over 3 years of professional experience and love working with ASP.NET, SQL Server and Raspberry Pis.
Search for a command to run...

Hi, I am data engineer from Nepal with over 3 years of professional experience and love working with ASP.NET, SQL Server and Raspberry Pis.
No comments yet. Be the first to comment.
In this series, we will explore git through commands and learn about commands that every developer should be aware about.
Git is one of the most popular version controlling system out there. It is a free and open source version controlling system. Git has become an integral part of software development. Git is a distributed version controlling system meaning multiple de...
In the previous article, we staged the changes we made to the files. Now, we will be committing our code to make the changes permanent and make additional changes on top of them. Committing changes Once we have staged our changes, we can now use git ...

Once we have set up our Git and the repository, we can get started with the version control. We can now work on files and directories in the repository, make changes, and commit those changes. Concepts of Staging When we create or edit an existing fi...

Git is one of the most popular version controlling system out there. It is a free and open source version controlling system. Git has become an integral part of software development. Git is a distributed version controlling system meaning multiple de...

In this article, we will be looking at how you can install git on your system. After installing git on the system, we can use it to version control the directories.
Installing git on a Linux is pretty straightforward. In the case of Debian-based linux which uses apt package manager, you can run the following command in the terminal.
$ sudo apt install git -y
While you might be using another Linux distro or package manager, you can use the respective package manager's installation command to install git package.
Installing git on a macOS is also straightforward. You can install git by running the following command.
$ brew install git
Installing git on Windows is a bit more tedious than on Linux/macOS if you go with the installer. You will have to download an installer from the Git downloads page. After downloading the preferred installer(standalone/portable). You will run the installer as administrator and go through the installer steps. You can pretty much Next your way out of the installer.
Another way to install git on Windows is with winget which is a Windows package manager for Windows 10 and Windows 11. You can run the following command in the command prompt to install git and go through the installer.
> winget install --id Git.Git -e --source winget
After the installation has been completed, we can start configuring the git. Some of the basic setups include the name and email of the author. This information can be set up on the git repository level or on a global level (applicable for all the git repositories for that user). Later when the user commits some changes in the git repository, the information setup in the config will be recorded. You can also change the information later if you want. You can set up info with the following command.
$ git config --global user.name "<Your name here>"
$ git config --global user.email "<Your email here>"
If you want, you can also set the config on the repository level. You can run the above commands without --global flag and the config will be limited to the repository you are on.
$ git config user.name "<Your name here>"
$ git config user.email "<Your email here>"
The global configuration we provided is stored in a .gitconfig file in the home directory of the user in Linux/macOS or the user's folder in Windows. The local config is stored in the config file inside the .git directory.
In this article we installed git on our system and configured the git. In the next article, we will work with a local repository.