git clone copies a repository. fork creates your own copy on GitHub.
Getting Started
What is Git?
Branching & Merging
Branches & Merging
Tags & Releases
Git Tags
Submodules & Subtree
Git Submodules
GitHub Actions
GitHub Actions CI/CD
Git Worktrees
Git Worktrees
Git LFS
Git LFS (Large Files)
Git
Beginner
FREE
Clone & Fork
Lesson 2 of 17
Beginner
Interactive
Syntax
GIT
git clone https://github.com/user/repo.git git clone --depth 1 URL
Clone and Fork
BASH
# Clone a repository git clone https://github.com/user/repo.git # Clone specific branch git clone -b develop https://github.com/user/repo.git # After forking on GitHub, clone your fork git clone https://github.com/YOUR-USER/repo.git # Add upstream remote git remote add upstream https://github.com/original/repo.git # Sync fork git fetch upstream git merge upstream/main
Practice
1
Exercise
Practice this concept.
Answer
Run the commands as shown above.
Quick Quiz
1
What did you learn?
This covers the basics.
Interview Questions
It is a fundamental Git feature.