Clone
In one line
Cloning downloads a remote repository to your local machine, including its full history and remote link.
In simple words
git clone copies an entire repository from a remote server to your local machine. It downloads every file, every commit, and every branch, and it sets up the remote connection so you can push and pull afterwards. Cloning is how you get a local working copy of a project.
When you clone, Git creates a new folder named after the repository, initializes a local repo inside it, fetches all the history, and checks out the default branch. The original remote is saved under the name origin, so git push and git pull work immediately.
Cloning is the starting point for contributing to an existing project. You clone the repo, create a branch, make commits, and push them back to the remote (or open a pull request if you do not have write access).
Example
# Clone a repository from GitHub
git clone https://github.com/user/project.git
# Clone into a specific folder name
git clone https://github.com/user/project.git my-project
# After cloning, you can immediately work
cd project
git statusgit clone downloads the full repo into a new folder. The remote is saved as origin for push/pull.
Related terms
Related Resources
Related Lessons
- What is Git?
Cloning is introduced with Git basics
Learn the fundamentals
Deepen your understanding with structured lessons on this topic.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.