Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
785 views
in Technique[技术] by (71.8m points)

visual studio 2017 - How to Import project code from local machine to Azure Repos?

I have existing code on local PC in Visual Studio that I want to Import to the Azure Repos project. I have already created the Project in Azure DevOps. I have used Team Explorer in VS 2017 to Connect to my DevOps project. I don't know how to do the initial Import.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

If you are using Git repo in Azure Devops, please refer below commands to import projects to Azure Git repo:

#In the local directory for the root of the project 
git init 
git remote add origin <URL for Azure Git repo> 
git add .
git status   
git commit -m "initial commit"  
git push -u origin master 

Then the project in the local machine will be managed in Azure Git repo.

Note: if the local project has already been managed in a local git repo, then you can skip git init command.

If you are using TFVC repo in Azure Devops, please refer below steps to import the local project to Azure TFVC repo:

  1. connect TFVC with VS

In VS -> team explorer -> Manage Connections -> Add an account -> enter the email address and password for sign in Azure Devops -> select the TFVC repo -> Connect.

enter image description here enter image description here

  1. map TFVC repo in a local directory.

Click Map & Get button to map the TFVC repo and download the files in the specified directory (as C:UsersAdministratorSourceWorkspacesGit2 in below example).

enter image description here

  1. copy the local project to the mapped directory and checkin changes

Copy your project in the TFVC repo mapped directory -> team explorer -> Source Control Explorer -> click Add items to folder icon -> select all the project files you copied in the mapped directory -> Finish -> Team Explorer -> Pending changes -> checkin the changes.

enter image description here

So the local project will be imported into the TFVC repo in Azure devops.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...