如何将项目代码从本地计算机导入 Azure Repos?

编程入门 行业动态 更新时间:2024-10-26 00:19:35
本文介绍了如何将项目代码从本地计算机导入 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 repo,请参考以下步骤将本地项目导入 Azure TFVC repo:

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

  • 将 TFVC 与 VS 连接
  • 在VS中->团队资源管理器->管理连接 ->添加帐户->输入用于登录 Azure Devops 的电子邮件地址和密码 ->选择 TFVC repo ->连接.

    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.

  • 在本地目录中映射 TFVC 存储库.
  • 点击地图 &获取按钮以映射 TFVC 存储库并下载指定目录中的文件(如以下示例中的 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).

  • 将本地项目复制到映射目录并签入更改
  • 在 TFVC 存储库映射目录中复制您的项目 ->团队资源管理器->源代码管理资源管理器 ->单击将项目添加到文件夹图标->选择您在映射目录中复制的所有项目文件->完成 ->团队资源管理器 ->待更改 ->检查更改.

    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?

    本文发布于:2023-10-15 01:17:18,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1492815.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:如何将   代码   计算机   项目   Repos

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!