Once Git is installed, using it is just a matter of navigating to the directory that you want to manage, and then initializing it. This process is called creating a Repository or repo for short.
Now we’ll create a couple of directories on C drive and initialize one of them as a repo.
1. First we’ll start Git Shell to create and initialize Git repo
Run Git Shell from the location where you installed Git
Command used: mkdir foldername
3. Now we’ll create a folder called repo where we’ll keep all our repos. All of our repositories are going to sit within this Repos folder.
(Command Explanation: cd – Change Directory to go within the directory)
4. We can check our present working directory by typing pwd
5. Initialize Git repo by using below command:
So G-I-T for Git, space, and then I-N-I-T for initialize, Gitinit. Hir Return key. As soon you hit Return, it tells you that it initialized an empty Git repository.
Git uses these files to track Git repository. Now we have created a directory, and we’ve initialized it as a Git repository. So, Git’s going to track all the files and all the folders in that directory, and it’s going to allow us to use Git commands, to control the versioning process.