我在 Azure DevOps 中有一个 git-repo,我想将其用作启动新存储库的模板,但没有原始存储库的提交历史记录。GitHub 有这个不错的功能 https://help.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-template-repository,但是我在 DevOps 中找不到好的方法。克隆它、删除 .git 并将其绑定到新的空存储库的唯一方法是吗?
Azure Repos 上没有开箱即用的解决方案,但您可以使用此解决方法(使用 git 存储库作为新项目的基础 https://softwareengineering.stackexchange.com/questions/313189/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}."
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)