Managing Multiple Remotes
Learn how to work with more than one remote repository, rename and remove remotes, and sync forks with upstream.
Managing Multiple Remotes is a free DevOps Bootcamp lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the DevOps Bootcamp learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Why Multiple Remotes?
A Git repository can talk to more than one remote at a time. The default remote is usually called origin, but you can add others.
originis typically your own copy (a fork)upstreamusually points to the original project
This setup is the backbone of open-source contribution workflows.
Listing Remotes
Use git remote -v to see every remote configured for your repo along with its fetch and push URLs.
git remote -v
origin https://github.com/you/project.git (fetch)
origin https://github.com/you/project.git (push)Adding a Remote
To add a second remote, give it a name and a URL with git remote add.
git remote add upstream https://github.com/original/project.gitFetching from Upstream
Once you have an upstream remote, you can fetch its branches without merging them into yours.
git fetch upstreamSyncing Your Fork
To bring your fork up to date with the original project, fetch upstream then merge its main branch.
git fetch upstream
git checkout main
git merge upstream/mainRenaming a Remote
Use git remote rename to change a remote's local name. The URL stays the same.
git remote rename origin myforkChanging a Remote URL
If a repository moves (for example from HTTPS to SSH), update its URL with git remote set-url.
git remote set-url origin git@github.com:you/project.gitRemoving a Remote
Drop a remote you no longer need with git remote remove. This only removes the local reference.
git remote remove upstreamPushing to a Specific Remote
When you have several remotes, name the one you want when pushing.
git push myfork feature-branchInspecting a Remote
git remote show displays detailed info: branches tracked, fetch/push URLs, and which branches are up to date.
git remote show upstreamTracking Branches Across Remotes
You can create a local branch that tracks a branch on any remote, making future pulls automatic.
git checkout -b release upstream/releaseQuick Check
Test your understanding of multiple remotes.
Recap
You learned to manage multiple remotes:
git remote -vlists remotesgit remote add/remove/renamemanage themgit fetch upstream+ merge keeps a fork in syncgit remote set-urlupdates a moved repository
This is the foundation of the fork-and-upstream collaboration model.
Frequently asked questions
Is the “Managing Multiple Remotes” lesson free?
Yes — the full text of “Managing Multiple Remotes” is free to read here on the web, and the DevOps Bootcamp course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the DevOps Bootcamp course, upgrade to CoddyKit PRO.
What will I learn in “Managing Multiple Remotes”?
Learn how to work with more than one remote repository, rename and remove remotes, and sync forks with upstream. You practise DevOps Bootcamp with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start DevOps Bootcamp?
No prior experience is required. DevOps Bootcamp on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Managing Multiple Remotes” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this DevOps Bootcamp lesson?
Yes. Every DevOps Bootcamp lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- GitHub Account & Repositories
- Pushing, Pulling, Cloning
- Collaborating with Remotes
- Managing Multiple Remotes