如何将项目代码从本地机器导入 Azure Repos? [英] How to Import project code from local machine to Azure Repos?

查看:29
本文介绍了如何将项目代码从本地机器导入 Azure Repos?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Visual Studio 中的本地 PC 上有我想要导入到 Azure Repos 项目的现有代码.我已经在 Azure DevOps 中创建了该项目.我在 VS 2017 中使用 Team Explorer 连接到我的 DevOps 项目.我不知道如何进行初始导入.

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.

推荐答案

如果你在Azure Devops中使用Git repo,请参考以下命令将项目导入Azure Git repo:

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 

那么本地机器上的项目就会在Azure Git repo中进行管理.

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

注意:如果本地项目已经在本地git repo中管理过,那么可以跳过git init命令.

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

如果您在 Azure Devops 中使用 TFVC 存储库,请参考以下步骤将本地项目导入 Azure TFVC 存储库:

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

  1. 将 TFVC 与 VS 连接

在 VS 中 ->团队浏览器 ->管理连接 ->添加帐户 ->输入用于登录 Azure Devops 的电子邮件地址和密码 ->选择 TFVC 存储库 ->连接.

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.

  1. 在本地目录中映射 TFVC 存储库.

点击地图 &获取按钮映射TFVC repo并下载指定目录中的文件(如下例中为C:UsersAdministratorSourceWorkspacesGit2).

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

  1. 将本地项目复制到映射目录并签入更改

在TFVC repo映射目录中复制你的项目->团队浏览器 ->源代码管理资源管理器 ->单击将项目添加到文件夹图标 ->选择您在映射目录中复制的所有项目文件 ->完成 ->团队资源管理器 ->待定更改 ->签入更改.

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.

因此本地项目将被导入到 Azure devops 中的 TFVC 存储库.

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

这篇关于如何将项目代码从本地机器导入 Azure Repos?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆