Open Source Guide

Clone a Repository

Learn how to clone a repository to your local machine

Clone a Repository

Cloning downloads a copy of your forked repository to your local computer so you can work on it.

Prerequisites

  • Git installed on your computer
  • A forked repository on GitHub
  • Terminal/Command Prompt access

Step-by-Step Guide

Step 1: Get the Clone URL

  1. Go to your forked repository on GitHub
  2. Click the green Code button
  3. Copy the HTTPS URL (recommended for beginners)

Example URL:

https://github.com/YOUR_USERNAME/LinuxDroid.git

Step 2: Open Terminal

  • Windows: Git Bash, PowerShell, or Command Prompt
  • macOS: Terminal
  • Linux: Terminal

Step 3: Navigate to Your Workspace

# Navigate to where you want to store the project
cd ~/Documents/Projects

# Or create a new directory
mkdir ~/Documents/GitHub
cd ~/Documents/GitHub

Step 4: Clone the Repository

git clone https://github.com/YOUR_USERNAME/LinuxDroid.git

You'll see output like:

Cloning into 'LinuxDroid'...
remote: Enumerating objects: 100, done.
remote: Counting objects: 100% (100/100), done.
remote: Compressing objects: 100% (80/80), done.
remote: Total 100 (delta 20), reused 100 (delta 20)
Receiving objects: 100% (100/100), done.
Resolving deltas: 100% (20/20), done.

Step 5: Enter the Directory

cd LinuxDroid

Step 6: Verify the Clone

# Check remote repositories
git remote -v

# Should show:
# origin  https://github.com/YOUR_USERNAME/LinuxDroid.git (fetch)
# origin  https://github.com/YOUR_USERNAME/LinuxDroid.git (push)

Add Upstream Remote

To keep your fork updated with the original repository:

git remote add upstream https://github.com/AryanVBW/LinuxDroid.git

# Verify
git remote -v

# Should now show both origin and upstream

Next Steps

You've successfully cloned the repository! You can now work on it locally. 🎉

Your Progress

0/12
0%