One of the main features of git is providing collaboration on development. This is possible by having a version of our repository online, thus any collaborator can download (clone) the repository and start developing separately. There is a whole chapter on remote and cloning which will be discussed later. For now as a starter we need to know how to clone a repository (sometimes called repo) on our local. Local means our machine and remote means somewhere else.
To manage repositories there are many platforms such as github, gitlab, gitbucket, etc. Their job is managing git repositories and providing services such as user management and so on which is another topic. Even though these services are closely working with git or similar source code managers, they are not part of git and they shouldn't be confused with git.
Here, we will use github. You will need an account in github to be able to connect your local repository to github repository (which mostly we will call it remote) . When you have created an account in github, then for each project or repository you need to create a repository and connect your local to the remote using the link provided by github.
I have created a public repository so all sample files and structures we discussed in this tutorial will be available for everyone in the repository.
The repository link is shown as below:
https://github.com/HamidMirghafoori/git-in-action.git
It is necessary you create your own account and repository to be able to proceed with this tutorial.
To download / clone the repository, first you need to navigate to the folder you want clone repo there, or later you can use destination address to create somewhere else which we don't mind it now. so navigate to your project folders and execute this command:
git clone https://github.com/HamidMirghafoori/git-in-action.git
The result will be a new folder named git-in-action which located the directory you already are in with all files and directories.