gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 07:32:27 25 4
gpt4 key购买 nike

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

最佳答案

如果您在 Azure Devops 中使用 Git 存储库,请引用以下命令将项目导入到 Azure Git 存储库:

#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 存储库中进行管理。

注意:如果本地项目已经在本地 git 存储库中进行管理,那么您可以跳过 git init 命令。

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

  1. 将 TFVC 与 VS 连接

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

enter image description here enter image description here

  • 将 TFVC 存储库映射到本地目录。
  • 单击映射和获取按钮映射 TFVC 存储库并下载指定目录中的文件(如以下示例中的 C:\Users\Administrator\Source\Workspaces\Git2)。

    enter image description here

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

    enter image description here

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

    关于azure - 如何将项目代码从本地计算机导入到Azure Repos?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52334570/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com