Today we are going to learn how to install and configure Git on windows and create our first repository. Now we have already learned that Git is a version control system, we can create a repository, we can create new files and commit them to the reposiory and also we can roll back the changes when needed. For more details you can refer our first article on Git ( Git from the scratch ).
First of all we will download the setup file for Git.
Go to Git home page – Git Home
You can go to the Downloads and click on windows, You will get the setup file downloaded automatically.
Follow the attached screenshots and Run the installation as an Administrator.
Likewise go ahead with the default options and after the Installation gets completed, Lauch Git Bash
We are in a window like below
We can find our current version of Git by using command – git –version
Create the Git Local repository
We need to create our new empty local GIT Repository inside of a new folder. To create the new repo we need to type the below command inside our new directory “myapp”.
Note – Local Git repository directory (.git) is always created as a hidden file.
Alternatively we can create a new repo by specifing a new project name
See if we give a specific name with the commad git init as above, it creates a new directory with the given name and the new local repo will be created inside of that new directory.
As we know Git is a version control system, it is tracking the changes done by every user. So in the beginning we must configure git by inserting our name and email address for the tracking purpose. To set those configurations, follow the below commands.
To check all the git configurations use the below command
git config –list
If you need to get Git help, use git help command.
I think you this article will help you to understand how to install and configure Git on windows PC. We will start learning the Git commands from an upcomming article.
Useful resources –