Featured image of post Pushing your code to GitHub and Azure Repos at the same time

Pushing your code to GitHub and Azure Repos at the same time

Pushing your code to GitHub and Azure Repos at the same time

If you have an existing repository hosted by an Azure Repos or in GitHub, you can add new remotes easily. Let’s see how we can do it!

Creating and versioning a local project

Let’s create our project. In an empty directory type the CLI commands below:

It will create a new .net core web application, with a gitignore file and versioned in a local git.

Image

Creating an Azure Repos repository and pushing your code

In your Azure DevOps account, follow these steps:

Image

In the next screen disable the ‘Add a README’ option and enter your repo name:

Image

In the empty repository created you have some options to push your code, we’ll push from an existing repository, so copy the command as the figure:

Image

In your terminal paste the command, remember to check if you’re in your project directory. The highlighted log will confirm if your push was successful:

Image

Refresh your Azure Repos page and your code was pushed!

Built with Hugo
Theme Stack designed by Jimmy