Want to copy someone else’s (or your own) repository from GitHub? Here’s how to do it through GitHub Desktop!
Three Ways to Clone
Method 1: From your repository list
For your personal repositories:
- Open GitHub Desktop
- File โ Clone Repository (or
Ctrl+Shift+O) - GitHub.com tab
- You’ll see a list of all your repositories
- Select the one you want
- Choose the Local Path (where to save it)
- Clone
โ In 10-30 seconds the repository will be copied!
Method 2: By URL
For any public or someone else’s repository:
- Find the repository on GitHub.com
- Click the green Code button
- Copy the HTTPS URL (e.g.:
https://github.com/username/repo.git) - In GitHub Desktop: File โ Clone Repository
- Go to the URL tab
- Paste the URL
- Choose Local Path
- Clone
Method 3: From the GitHub website (easiest!)
One click:
- On the repository page click Code
- Choose Open with GitHub Desktop
- Confirm in the browser dialog
- GitHub Desktop will open automatically
- Choose a folder โ Clone
๐ Done!
What to Choose: HTTPS or SSH?
GitHub Desktop uses HTTPS by default โ and that’s perfect for beginners!
HTTPS:
- โ
Works out of the box
- โ
No setup required
- โ
Works through firewalls
SSH: (for advanced users)
- Requires generating keys
- Settings on GitHub
- Slightly faster
For now, use HTTPS!
After Cloning
Check the result
In GitHub Desktop you’ll see:
- History tab โ all commits
- Current Branch โ main branch (usually
main) - Fetch origin โ button to check for updates
Open the project
In an editor:
- Repository โ Open in Visual Studio Code
- Or: Ctrl+Shift+A / Cmd+Shift+A
In file explorer:
- Repository โ Show in Explorer (Windows)
- Repository โ Show in Finder (macOS)
- Or: Ctrl+Shift+F / Cmd+Shift+F
Update the code
If the author updated the repository:
- Click Fetch origin
- If there are updates, Pull origin will appear
- Click Pull to download the updates
Cloning vs Forking
Clone
What: Just a copy for reading/learning
When:
- Want to study the code
- Run the project locally
- Don’t plan to make changes
Problem: Can’t push (upload your changes)
Fork + Clone
What: A copy IN YOUR account + cloning
When:
- Want to make your own changes
- Create a Pull Request
- Build your own version of the project
Steps:
- On GitHub.com click Fork (top right)
- The repository will be copied to your account
- Now clone YOUR copy through GitHub Desktop
โ Now you can make commits and push!
Working with Forks
After Fork + Clone:
Original: github.com/author/repo
โ (Fork)
Your fork: github.com/YOU/repo
โ (Clone)
Your computer: ~/Projects/repo/
Make changes:
- Edit files
- Make commits in GitHub Desktop
- Push origin โ upload to your fork
- On GitHub.com create a Pull Request to the original
Sync with the original:
The author updated the repository and you want those changes?
In the terminal:
# Add the original as upstream
git remote add upstream https://github.com/author/repo.git
# Download updates
git fetch upstream
# Merge into your branch
git merge upstream/main
Or on GitHub.com:
- Open your fork
- If there are updates, you’ll see: “This branch is X commits behind”
- Click Sync fork โ Update branch
- In GitHub Desktop: Pull origin
Common Issues
“Authentication failed”
Cause: GitHub Desktop can’t log in.
Fix:
1. File โ Options โ Accounts
2. Sign out โ Sign in again
“Permission denied”
Cause: Repository is private and you don’t have access.
Fix:
- Ask the owner to add you as a collaborator
- Or fork it (if the author allows)
Cloning takes forever
Cause: Large repository or slow internet.
Fix:
- Wait it out (some projects are > 1GB)
- Check your internet speed
- Try again later
“Repository not found”
Cause: Wrong URL or the repository was deleted.
Fix:
1. Check the URL
2. Make sure the repository exists
3. Verify it’s public (or that you have access)
Best Practices
โ Organize your folders:
~/Documents/GitHub/
โโโ my-projects/
โโโ cloned-for-learning/
โโโ forks/
โ
After cloning:
1. Read README.md
2. Check for package.json / requirements.txt
3. Install dependencies
4. Run the project following the instructions
โ
Don’t commit to a cloned project you don’t own!
- Fork it
- Create your own branch
- Only then commit + push
โ
Update regularly:
- Click Fetch origin
- Pull if there are changes
Cloning is the first step to studying someone else’s code! Good luck! ๐ฆ
๐ฌ Comments (0)
No comments yet
Be the first to share your opinion about this article!