删除 Azure Devops (VSTS) 中的 git 分叉关系

Remove a git fork relationship in Azure Devops (VSTS)

我通过分叉另一个项目创建了一个 Azure Devops (VSTS) 项目。现在,每当我们克隆新项目时,您都会在控制台输出中获得对原始项目的引用

remote: This repository is a fork. Learn more at https://aka.ms/whatisafork.
remote: To add its upstream as a remote, run:
remote: git remote add upstream <link to original repo>

有没有办法打破这种联系,使新项目永远不会引用旧项目?

如果你不想再have a fork,你可以试试:

  • 克隆那个 fork
  • 删除 VSTS 分叉存储库
  • 新建一个空的
  • 更改本地克隆的远程 URL

    git remote set-url origin /URL/new/VSTS/repo
    
  • 推一切

    git push --mirror
    

您可以从您的 master 创建一个新分支。然后将其设为默认分支。 删除你的 main ,现在拉动不会自动回到上游。