Skip to main content

Git - Create new repo in on-prem Azure Devops

Create a new repo in the web portal and push code 

This is the standard approach for managing new code in Azure DevOps. 

  1. Navigate to your project: Open the web portal for your Azure DevOps Server and select your project.
  2. Go to Repos: In the left-hand navigation menu, select Repos > Files.
  3. Create a new repository: From the current repository drop-down menu at the top, select New repository.
  4. Configure the new repo:
    • Verify that Git is the repository type.
    • Enter a name for your new repository.
    • Optionally, add a README file or a .gitignore file.
  5. Create: Select Create. An empty Git repo is now ready in your project.
  6. Clone the repo locally: Once the repo is created, an overview page will appear with a Clone button. Copy the provided clone URL.
  7. Open a command prompt on your local machine and navigate to the folder containing your local code (if you have existing code).
  8. Connect your local repo to the remote:
    git init
    git add .
    git commit -m 'initial commit'
    git branch -M master
    git remote add origin <clone URL>
    git push -u origin master
    • Run git remote add origin <clone URL> means that you can use the clone URL from within Azure DevOps 
    • Run git push -u origin [main or master] (or the name of your default branch) to push your local code to the newly created Azure DevOps repo.