Hello everyone ??, welcome to the 2nd week of the blog series, Hello World to Git and GitHub.
I hope last week we got some ground info about what is Git and GitHub. So this week the discussion will be, how to get started with git.
To start using the features of Git we need to install the required software in our operation system.
Git can be installed in pretty much every operating system out there. Therefore there are no limitations for installing git on your preferred operating system.
In fact, Git comes installed by default on most Mac and Linux machines! If you think Git is already installed in your operation system, there are ways to check that. To check the availability of the git or the version of the git you can simply type;
On your terminal. If the git is already installed in the system, that command will give you the version of the git installed, or if it is not in the system, you will get a “command not found” message.
Don’t have git installed in the system?
In this section, let’s talk about how to install Git inside major operating systems separately.
Installing Git inside Windows
Inside windows, we have 2 solutions of git. If you are a terminal lover you can use git bash which is like the windows command prompt. There you have to type and executes commands.
Or else, git comes with a Graphical User Interface(GUI), if you are not willing to type commands inside the terminal(FYI: hereafter I will be using git bash word instead of command prompt).
Steps to install Git on Windows:
- First, we have to download the installer file. The installer file can be download from the below link
- Like the other windows installers, this is a straight forward installation set up, so you can easily install git on windows with proper options.
- Once the installer is done with the installation process, you can rerun the git version command to check the version of the git. The latest version should be version 2.29
- If you are aware of package manager software, we can use chocolatey package manager on windows to install Git
Installing Git inside macOS
Now let’s see how we can install Git on macOS. Most of the macOS version has already installed Git. But if you have some older version of macOS, let’s install git.
Unlike on windows, here we have 2 options to install Git. the easiest way is you can simply download the installer from the internet and install. It’s that easy. Or else we can use some package manager installing software to install Git on macOS.
- Installing Git from the installer
- We can download the Git installer through this link and install it.
- This process is more similar to the installation process of Git on Windows.
- Installing Git using a package manager software (In this case homebrew)
- In most cases, the homebrew package manager is already installed inside the macOS. Therefore we can simply run the installation command and install the required packages.
- To install git using let’s run:
brew install git
- Once all the dependencies are download and installed, we can run the git version to check the installation
Installing Git inside Linux
If we are using Debian or Ubuntu as the operating system we could use the apt-get package manager to install git
- In order to install git, we have to run these commands orderly
sudo apt-get update
sudo apt-get install git
- Then we can run
git versionto check the git version
If we are using fedora we can use yum or dnf package managers to install git
Sudo dnf install git
Sudo yum install git
So, now we have finished the installing part of the Git??
Then what we have to do is, configuring the username and the email for our git bash. The reason we are doing is, when we are performing git operations it needs to verify our identity, therefore we have to configure the username.
Configuring the username and other credentials needed for the Git bash
Let’s Configure ourGit username and email using the following commands. These details will be associated with any commits that you create
Git config --global user.name “your git username”
Git config --global user.email “your git email address”
I think now we are good to have some practical session on git. For that, let’s see you guys with the next episode
Thank you ❤?