How do I clone or download a repository from GitHub to my computer?
You'll be able to: Clone a GitHub project to your local computer using the terminal and git clone
- Risk
- Safe to try
- Windows
- Windows 11 · Windows 10
Filed under Programming & tools
The steps
- 1
On the project's GitHub page in your browser, click the green Code button and copy the HTTPS web link. A dropdown reveals the repository web address (ending in .git) with a small copy icon.
GitHub project page showing the green Code button with the HTTPS URL copied.
Screenshot on the way. The steps above are complete without it.
What does cloning mean?
Cloning creates a full local copy of all project files and its git history on your computer so you can edit and run the code.
- 2
Open the folder on your computer where you want to keep your project (such as Documents or a Projects folder). File Explorer shows your destination folder ready for new projects.
- 3
Right-click an empty area inside the folder and select Open in Terminal (or open VS Code and press Ctrl`). A black or blue command terminal window opens directly inside this folder path.
Terminal window showing the current directory path ready for commands.
Screenshot on the way. The steps above are complete without it.
- 4
Type
git clonefollowed by pasting your copied link, then press Enter. Terminal outputs "Cloning into...", downloads objects with a progress percentage, and says "done". A new folder with the project name appears inside your directory.
It looks different on my screen
If you do not want to use Git commands, click the green Code button on GitHub and select Download ZIP to download the project as a regular compressed file.
Did this work?