0Pricing
DevOps Bootcamp · Lesson

Collaborating with Remotes

Learn how to add and manage multiple remote repositories, enabling seamless collaboration across teams.

Collaborating with Remotes is a free DevOps Bootcamp lesson on CoddyKit — lesson 3 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?

Collaboration often involves more than just your own repository. Sometimes you contribute to an open-source project, or work with different deployment environments.

Git allows you to manage multiple remote repositories for a single local project. This lesson will show you how to set them up and use them effectively.

What is a Remote?

A remote is essentially a version of your project hosted on the internet or a network. When you clone a repository, Git automatically sets up a remote named origin, pointing to the original repo.

But origin is just a default name! You can have many remotes, each pointing to a different location or purpose.

See Your Current Remotes

To see which remotes are currently configured for your local repository, you can use the git remote -v command. The -v stands for "verbose" and shows you the URLs associated with each remote.

git remote -v

Adding a New Remote Connection

To connect your local repository to another remote, use git remote add. You'll give it a short, memorable name (like upstream or staging) and provide its URL.

git remote add <name> <url>

Example: Adding an Upstream Remote

Imagine you forked an open-source project. Your fork is typically named origin. To keep your fork updated with the original project's changes, you'd add the original project as an upstream remote.

Here's how you'd add it:

git remote add upstream https://github.com/original-org/project.git

Fetching from a Specific Remote

Once you have multiple remotes, you can download changes from a specific one without merging them into your current branch. This lets you see what's new on that remote.

Use git fetch <remote_name> to do this.

git fetch upstream

Pulling from a Specific Remote

While git fetch only downloads changes, git pull downloads and immediately merges them into your current branch. You can specify which remote and branch to pull from.

This is common when syncing your fork (origin) with the original project (upstream).

git pull upstream main

Pushing to a Different Destination

By default, git push sends your changes to the origin remote. However, you can direct your push to any configured remote.

This is useful for deploying to a specific server, or pushing a feature branch to a different fork or a temporary testing environment.

git push production main

Renaming and Removing Remotes

You can manage your list of remotes:

  • Rename a remote: If its name no longer makes sense, use git remote rename <old_name> <new_name>.
  • Remove a remote: If you no longer need the connection, use git remote remove <name>.

Quick Check on Remotes

You've forked a project and added the original repository as an upstream remote. You want to update your local main branch with the latest changes from the original project's main branch.

Recap & Next Steps

Great job! You've learned how to manage multiple remote repositories:

  • Use git remote -v to list configured remotes.
  • Add new remotes with git remote add <name> <url>.
  • Fetch changes from specific remotes using git fetch <remote>.
  • Integrate changes with git pull <remote> <branch>.
  • Push to different remotes using git push <remote> <branch>.

Mastering multiple remotes is key for advanced collaboration, especially in open-source projects. Next, you'll dive into GitHub collaboration with Pull Requests!

Frequently asked questions

Is the “Collaborating with Remotes” lesson free?

Yes — the full text of “Collaborating with 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 “Collaborating with Remotes”?

Learn how to add and manage multiple remote repositories, enabling seamless collaboration across teams. 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 3 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Collaborating with 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

  1. GitHub Account & Repositories
  2. Pushing, Pulling, Cloning
  3. Collaborating with Remotes
  4. Managing Multiple Remotes
← Back to DevOps Bootcamp