Remotes

Christine_Yang271 total contributions
Published Sep 27, 2023Updated Sep 27, 2023
Contribute to Docs
Git remotes are copies of repositories that are not stored locally. Working with a remote often involves two copies or references:
- The forked repository (repo): By convention, these are named the
origin
remote which refers to the default repo. - The base or home repo: The
upstream
remote refers to the remote repo that is being tracked for changes and contributions.
Syntax
Remotes can be set with the git remote add
command:
git remote add remotename remoteURL
Adding Remotes Using Docs
To manually set up the remotes, the forked repository would be named the origin
remote:
git remote add origin https://github.com/yourusername/docs.git
The base Codecademy/docs
repo would be named the upstream
remote:
git remote add upstream https://github.com/Codecademy/docs.git
Note: If the repository is cloned onto the computer, the remote defaults to
origin
. Additional set up would only be needed for theupstream
remote.
Run the git remote -v
(v
flag is for verbose) command to check the list of remotes:
git remote -vupstream https://github.com/Codecademy/docs.git (fetch)upstream https://github.com/Codecademy/docs.git (pull)
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.