Reputation: 797
I am trying to push my existing visual studio project code to Azure Devops server (first time). All the tutorials start with create a new project on the AzureDevops and then clone to Visual Studio. Can anyone tell me how to push my existing project to server. Can I upload the files (including folders)? Thanks.
Upvotes: 9
Views: 36003
Reputation: 15759
In 2023, this process is very easy to do now but sadly has very poor documentation online. Microsoft has updated Visual Studio 2022 with a much better user interface to help users integrate a local project from the IDE up to Azure DevOps.
No more silly Git commands. Yes!!
FIRST OPEN UP YOUR DEVOPS WEBSITE
https://dev.azure.com/{your_organization}
"New Project"
, give it a name, scroll down and under "Advanced"
choose "Git"
for "Version Control"
, and click "Save"
. It will create a project but also a dummy Git repository with the same name as the DevOps Project. You will need to change its name to your Visual Studio 2022 project name. (FYI..."Git"
is Microsoft's Azure Repos 'Git' product and replaces the old Team Foundation source safe model. It uses a proprietary form of Git that is stored in a SQL Server database on their Azure Cloud platform used by Azure Dev Ops. So, it works like Git and uses Git but its managed and stored differently.)"Project Settings"
. Scroll down and click "Repositories"
. A page appears to the right with your default repository listed. Click the three dots ...
to the right and choose "Rename"
. Change the name of your repository in DevOps to match your Visual Studio 2022 solution/project name.. This will allow your to overwrite the DevOps empty repo with your own.OPEN UP YOUR VISUAL STUDIO 2022 PROJECT
"Azure DevOps"
(instead of GitHub, the default) from the left menu. Then under it choose "Existing remote"
."Remote URL"
. This is where you will enter the Azure DevOps "Clone URL" that connects your Visual Studi0 2022 project with the Azure DevOps repository.
"Clone"
or "Clone Repository"
button and copy the URL to the full DevOps path to your repository."Remote URL"
field. Make sure it has the FULL URL PATH to your DevOps repository."Create and Push"
should no longer be grey now. Press it and it will upload your Visual Studio 2022 solution/project into DevOps and replace the empty repository with the same name on Azure DevOps! (If it asks to log into your Microsoft DevOps and/or Visual Studio accounts follow the prompts in Visual Studio 2022)Team Explorer
tab. The Visual Studio 2022 IDE now has beefed up tools to do push
and pull
Git commands for you with arrows and buttons in a simpler interface. You are now using Git in the IDE to communicate back and forth with your Azure Dev Ops repositories which is much simpler and faster now than stopping to type in commands.Peace
Upvotes: 0
Reputation: 766
There are two ways provided by Azure DevOps that you can push your existing project to it.
Please follow this article for detailed information and also you can check below steps:
For the first situation, assume you have the project created already in your local VS:
a. Open your project in VS, click File in VS tool bar, click “Add to Source Control” in the menu and you will see in the little blue lockers beside your project files in Solution Explorer.
b. Open Team Explorer( you can find it in View in VS tool bar in case), click the small down arrow to open the menu, select “Sync”.
c. Now you can see the Synchronization menu, choose “Push to Azure DevOps” and click “Publish Git Repo”.
d. Fill the form like below and then click “Publish Repository”. Now you can see a new project with the name in your Azure DevOps organization now.
For the second situation, there’s difference in the step c, you have to choose the “Push to Remote Repository” and click “Publish Git Repo”, paste the HTTP code you can copy from your new created project in Azure DevOps – Repos. You can see it more clear in the article I provided.
Can I upload the files (including folders)?
Yes, any file and folder in your project will be pushed to Azure DevOps at the same time.
Upvotes: 9
Reputation: 2848
Flow the instruction when you create new project or new repository.
Upvotes: 0