Home > EN, Tips & Tricks > How to add another repo/remote to the same folder directory

How to add another repo/remote to the same folder directory


Overview

Usually all source code version control is done inside our company repo but in some situations we need to publish the code to the customer’s repo when a new version is ready to production.

It’s not rare to send over the code zipped but then the customer will not be able to track the changes made on those files.

But now that DevOps concepts is on the spot we are also entitled to publish the release version to the customers’ repo and this action will trigger some code analysis, tests, and deployment!

So why not push the code/branch directly to customer’s repo maintaining the commits that had been made during development.

Solução

In this post I’ll use two repos that I created previously:

I’ve published a .NET Core project with some initial commits on GitHub’s repo:

2020-01-19_1

2020-01-19_2

Now, to push these files to Azure DevOps repo with the commits history we need to add another remote to our local repo:

  • Git remote add <alias> <remote-git-url>

2020-01-19_3

To push the “secondary” repo:

  • Git push secondary

2020-01-19_4

Done! We can see our code (with history) on Azure DevOps repo!

2020-01-19_5

  1. No comments yet.
  1. No trackbacks yet.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.