Learn how to contribute to a Git repo that's already been created, clone a Git repo using Visual Studio Code, and give someone access to your private GitHub repo with these easy-to-follow steps.
This exercise is excerpted from Noble Desktop’s Git & GitHub training materials and is compatible with updates through 2022. To continue learning web development with hands-on training, check out our coding bootcamps in NYC and live online.
Contributing to Someone Else’s Repo
When you want to start contributing to a Git repo that has already been created, you can clone it (download a copy) from GitHub. If it’s a private repo, they need to invite you.
Clone a Git Repo
- First you’ll need the URL of the Git repo. When viewing the repo on GitHub, click the Code button to see the URL. Copy that URL by clicking the button to its right.
- In Visual Studio Code choose File > New Window.
- Open the Source Control panel
on the left of the window.
- In the Source Control panel
click Clone Repository.
- In the panel that appears at the top the window, paste the URL (or git clone command) and hit Return (Mac) or Enter (Windows).
-
You’ll be asked where you want to store the repo.
Navigate to the folder where you want to store the repo (a new folder for the repo will be created here) and click Select Repository Location.
If you’re asked Would you like to open the cloned repository? (at the bottom right of the VS Code window) click Open.
Giving Someone Access to Your Private GitHub Repo
If you have a private GitHub repo that you want someone else to contribute to:
- On github.com go to the page for your repo.
- Click the Settings tab.
- In the left sidebar, click Manage access.
- Click Invite a collaborator.
- Enter the person’s email address and follow any remaining prompts.