0

What is the URL for a new Azure DevOps Git repos if the project is in Visual Studio on my local machine? Where do you get this URL?

Don Baechtel
  • 627
  • 1
  • 6
  • 9
  • You have to decide what the URL is going to be, by figuring out what the address is of the remote repository to which you will be pushing your project. – Tim Biegeleisen Sep 16 '18 at 15:17
  • 1
    Possible duplicate of [How to Import project code from local machine to Azure Repos?](https://stackoverflow.com/questions/52334570/how-to-import-project-code-from-local-machine-to-azure-repos) – Daniel Mann Sep 16 '18 at 19:23

2 Answers2

1

If you mean that your project already exists locally and you want to push it to Azure's Git service, then:

  1. Create a new repo from the Azure console.

enter image description here

  1. From the top right corner, click the Clone button.

enter image description here

  1. Copy the HTTPS or SSH URL (depending on your preferred method). It should be something like https://[user]@dev.azure.com/[org|user]/[project]/_git/[repo] or git@ssh.dev.azure.com:v3/[user|org]/[project]/[repo] respectively.

enter image description here

  1. In your local terminal, run
git remote add origin [url]

Where url is the URL for your repo copied from the Azure console.

Mig82
  • 4,856
  • 4
  • 40
  • 63
0

If you created the repo locally (such as via git init), it's not in Azure DevOps/VSTS.

You'll need to create a repo in Azure DevOps/VSTS, add a remote in your local repo, and push your local repo to the server.

When you create an empty repo in Azure DevOps/VSTS, it will give you precise instructions for how to do this.

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
  • I don't know how to: * create an empty repo in Azure DevOps without a URL * formulate the URL for the empty repro * or push my local repo to the server I just want to put my VS project code into Azure DevOps repo. How does one do this? Why is it so difficult to do (many steps, not well documented) ? – Don Baechtel Sep 16 '18 at 19:05
  • @DonBaechtel When you create the repo, it will give you the URL. – Daniel Mann Sep 16 '18 at 19:06
  • https://learn.microsoft.com/en-us/azure/devops/repos/git/create-new-repo?view=vsts – Daniel Mann Sep 16 '18 at 19:08
  • 1
    Let's go back to the original question. I have a project locally in Visual Studio 2017 and I want to put it in Azure DevOps. What are the steps required to do this? – Don Baechtel Sep 16 '18 at 19:10
  • @DonBaechtel My answer and the documentation explains the process. Create a repo in Azure Devops, add a remote to your local repo, then push it to Azure Devops. – Daniel Mann Sep 16 '18 at 19:16