Cloning a GitHub repository creates a local copy of the remote repo. This allows you to make all of your edits locally rather than directly in the source files of the origin repo. Here’s how to clone a GitHub repository.
The first thing you’ll need to do is download and install Git on your computer. The installation process is straightforward and brings you through a lot of boilerplate information. The one thing you want to be careful with is that you allow Git to be used from the command line.
Let the wizard guide you through the rest. Once the installation is complete, you’ll be ready to clone the GitHub repository.
The next thing you’ll want to do is decide where to store the repo on your local machine. We recommend making a memorable folder so that you can easily navigate to it using the Command Prompt later.
On the right side of the screen, below the “Contributors” tab, you’ll see a green button that says “Clone or Download.” Go ahead and click that. In the window that appears, select the “Clipboard” icon to copy the repo URL to your clipboard.
Next, open the Command Prompt (on Windows) or whichever terminal you happen to be using on your computer.
In the terminal, navigate to the location in which you would like to store the repo. You can do so by typing the following command:
$ cd <directory>
In our example, we would enter
$ cd Documents\GIT local .
Note: You can skip this step by using
git <repo-url> <directory> to clone the repo directly to the specified directory instead.
Now, with the repo URL still copied to your clipboard, it’s time to clone the repo. Enter the following command:
$ git clone <repo-url>
In this case, we’d use
Give the process a few moments to complete. Here’s what it looks like if everything went smoothly.
As a matter of good practice, check to make sure that the repository is on your machine. To do so, navigate to the directory in which it was stored.
Now you can start making edits to the directory using your favorite text editor!
- › How to Check and Update Your Git Version
- › How to Convert Linux Installation Packages to Other Formats
- › How (and Why) to Create a GitHub Repository
- › How to Fork a GitHub Repository
- › What Do “FR” and “FRFR” Mean?
- › Logitech MX Mechanical Keyboard Review: Easy on the Eyes, Not the Fingertips
- › What’s New in Chrome 102, Available Now
- › AMD’s Ryzen 7000 Series Are the First 5nm Desktop CPUs Ever