【问题标题】:Create template git-repo in in azure devops在 azure devops 中创建模板 git-repo
【发布时间】:2020-08-10 15:42:06
【问题描述】:

我在 Azure DevOps 中有一个 git-repo,我想将其用作启动新存储库的模板,但没有原始存储库的提交历史记录。 GitHub has this nice feature,但是我在 DevOps 中找不到好的方法。是克隆它、删除 .git 并将其绑定到新的空仓库的唯一方法吗?

【问题讨论】:

标签: git azure-devops azure-repos


【解决方案1】:

Azure Repos 上没有开箱即用的解决方案,但您可以使用此解决方法 (Using a git repository as the base of a new project):

与其进行完全克隆只是为了再次删除 .git 目录, 您只能检索要启动的存储库的存档 来自。

$ mkdir new-project/
$ cd new-project/
$ git archive --remote="${giturl}" HEAD | tar -x
$ git init
$ git add -A
$ git commit -m "Staring off with revision ${rev} of repository ${repo}."

【讨论】:

  • 谢谢,这可行,但容易出错。我们的解决方案是克隆“模板”存储库,然后创建一个新存储库,克隆它并手动将所需内容从模板复制到新存储库。我觉得自己像个穴居人
【解决方案2】:

恐怕Azure devops中目前还没有Creating a template repository这样的功能。

作为一种解决方法,因为在 github 中有创建模板存储库的功能,所以我们可以先将 repo 从 azure devops 导入到 github。

然后在github中创建一个模板repo,最后将创建的模板repo导入到azure devops中。

另外,我认为你想要的是一个好主意!您可以在我们的UserVoice 网站上发布此功能请求,这是我们产品建议的主要论坛。如果产品团队查看更新,他们将提供更新。感谢您帮助我们构建更好的 Azure DevOps。

【讨论】:

  • 将我们公司的东西放在github上并导入到devops并不是一个真正可行的解决方案。 DevOps 中的所有其他功能都有模板,但没有这个。
猜你喜欢
  • 2022-10-21
  • 1970-01-01
  • 1970-01-01
  • 2020-08-13
  • 1970-01-01
  • 2021-06-25
  • 2021-03-12
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多