gpt4 book ai didi

git - 在 azure devops 中创建模板 git-repo

转载 作者:行者123 更新时间:2023-12-04 15:29:47 25 4
gpt4 key购买 nike

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

最佳答案

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

Instead of doing a full clone only to delete the .git directory again, you can only retrieve the archive of the repository you want to start from.



$ 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}."

关于git - 在 azure devops 中创建模板 git-repo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61452886/

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