As far as our knowledge goes, to start working on a project on GitHub you should first create that project from scratch on your profile, fork an interesting project to your account or directly clone to a local folder someone else’s project. Whatever the situation is, the key step is to clone the repository to your local computer, where actually the work will take place.
When I first started on GitHub, a big doubt was about what actually meant the word cloning. Well, it’s very simple: it means copy the project repository, that is, the whole project itself, to a folder on the local computer. Going a bit more technical, it means to copy the master branch together with information on all branches associated to that project – so that you can change between branches.
An interesting thing of cloning is that it can be done as many times as possible. You can actually think about the repository as an online backup. Many times, when things in my project’s folder simply get too messy, and I have nothing to loose or backups to care about, it is easier for me to simple delete the project’s folder and clone it again from scratch that trying to checkout the previous commits or maneuvers alike. Also if you find yourself in a different computer, simply cloning your repository and up are up to go. Sometimes, if you are continuing your work in a computer which you have not used for a long time and the project there is way behind the current version, it is easier to delete the old folder and clone again from the server than trying to update an old version.
Cloning a GitHub repository to your computer
You have created a project in your Git account and you want to clone it to your computer so that you can work on it. Or you have forked a project, or just want to clone somebody else’s open project…
Simply, go to the parent folder where you wish to store the project files and do:
git clone <url>
where <url> is the project url :-) for example:
git clone https://github.com/joaomcteixeira/hello-world
This creates the subfolder hello-world in the location where you typed the above clone command. If you want to clone a repository to a specific folder, just add the folder name after the url.
git clone <url> <folder>