Explore our extensive collection of courses designed to help you master various subjects and skills. Whether you're a beginner or an advanced learner, there's something here for everyone.
Join us for our free workshops, webinars, and other events to learn more about our programs and get started on your journey to becoming a developer.
For all the self-taught geeks out there, here is our content library with most of the learning materials we have produced throughout the years.
It makes sense to start learning by reading and watching videos about fundamentals and how things work.
Data Science and Machine Learning - 16 wks
Full-Stack Software Developer - 16w
Search from all Lessons
Curated list of small interactive and incremental exercises you can take to get better at any coding skill.
Curated section of projects to build while learning with simple instructions, videos, solutions, and more.
Guides on different topics related to the technologies that we teach in our courses
You can clone a git repository as simply as follows:
<git-repository-url> should be replaced by the link of the repository that you want to clone, like this:
Cloning a repository creates a local copy of the desired project/repository on your computer, which syncs between the two locations (Remote-Local).
In other words, cloning a repository means downloading a complete copy of it to your computer. And what does a complete copy mean? Well, it means that after cloning a repository, you will have the entire history of the repository on your computer.
So why clone a repository you may ask? Cloning a project has many benefits as:
And all this without the need to be connected to the internet. We will only need an internet connection when we want to "share" our work with someone else, or we want to upload our work to GitHub.
In the following section, we will dive in on more detailed examples of how to clone a github repository and also how to fork any github repository.
For this example, we will clone one of 4Geeks popular repositories, that is 4Geeks react-flask-hello. The steps to clone this repository are as follows:
my-first-cloned-repoas shown below.
cdand add/copy the directory/folder location/path. Since we want to save the repository in our folder
my-first-cloned-repo, let's copy the folder's path
C:\Users\rafam\Programming Projects\my-first-cloned-repoand paste it on the terminal, you can also drag and drop the folder on the terminal and press enter
git clonealong with the copied URL
It is important to understand that you can clone any repository not only from GitHub but from any other site if you have the git URL. Remember that you clone a repository with the
git clone <url> command.
The difference between forking and cloning a project/repository really comes down to how much control a developer is allowed to have over a given repository.
By Forking, you can make your own copy of a repository somewhere else (for example, GitHub). Owning a copy of the repository means that you can make changes to it without affecting the original repository.
Cloning creates a local copy of a repository. Imagine doing that by downloading a repository to your computer's local storage. Clones have references to their original repositories, unlike forks.
So you want to make your own copy of a repository, let's make a copy of the one that we cloned in the example above, 4Geeks react-flask-hello.
The steps to fork the repository are the following:
Go to the GitHub repository 4Geeks react-flask-hello
Click the Fork button located in the top right corner of the page
mainbranch only) that allows you to only copy the main branch, if you want to copy the whole repository with all of its branches, then this box should be unmarked.
You can also use the GitHub Desktop App to clone a repository to your computer, once you have downloaded the GitHub Desktop App here, and being signed to the GitHub website and Desktop App, then you can follow these steps:
The GitHub Desktop App will automatically open on your computer and a window called Clone a repository will be displayed. Here you can confirm the repository to be cloned, and you can change the local path where the repository will be saved by clicking the Choose... button, or you can just copy the path and paste it into the corresponding field.
The following video describes the step by step of everything that has been explained in this GitHub Clone Repository article: