In this blog, we're going to see how to create a git repository in Azure DevOps and add existing code into that repository.
Introduction
You can use Git repos in your projects to manage your source code as your project grows. This guide shows you how to create a Git repo using the web portal and add your existing source code into git repository using command prompt
I am going to divide this session into two parts,
- Create a Git repository in Azure DevOps.
- Add your code to the Git repository
I) Create a Git repository in Azure DevOps
Step 1
Open DevOps and choose the respective project.
Click on Repos

Step 2
From Repos click on Files and click on the repositories which is already there, in my case it is "Internal". From the dropdown click on "New repository".

Step 3
A panel will appear in that Choose Repository type as Git.
Give Repository Name as per requirement, in my case I have given as "Test Repository".
You can uncheck Add a README checkbox, Normally it will add a readme.txt file in the repository if it is checked.
After that click on Create button.

Once the Repository is created it will get selected by default.

II) Add your code to the Git repository
Step 1
Now open a command prompt and locate your file location by giving cd <<File Location>>








Koshila SenadhiraPosted Nov 29, 2022, 7:28 AM
Nice Article! Thanks for sharing!
Jose Luis OlivarezPosted Sep 9, 2022, 8:31 PM
Thank you!!
Ramakrishnan RPosted Jan 31, 2022, 10:09 AM
Thanks for sharing!