gpt4 book ai didi

Git_GitHub Fork only master branch of a repo

转载 作者:行者123 更新时间:2023-12-02 00:03:50 24 4
gpt4 key购买 nike

我正在研究 this项目。由于它相当大,上游 repo 有很多分支,但我真正关心的是 master 分支。我需要从 master 的实际状态开始 fork repo 并创建一个新分支。我不关心所有其他“正在进行的工作”分支,我将拥有自己的分支。

从我的角度来看,有没有一种方法可以 fork repo 协议(protocol),但只能 fork 主分支,以保持事情的清洁。如果稍后我尝试发出 merge 请求,这会导致问题吗?

谢谢,安德里亚

最佳答案

关于 GitHub,现在(2 年后的 2022 年 7 月)这是可能的。

You can now fork a repo and copy only the default branch

Previously, when creating a fork all branches from the parent repository were copied to the new fork repository.

There are several scenarios where this is unneeded, such as contributing to open-source projects.
When all branches are copied, it could result in slow repo cloning and unnecessary disk usage.

With this new feature, only the default branch is copied; no other branches or tags.
This may result in faster clones because only reachable objects will be pulled down.

New fork page with ability to copy only the default branch

If you want to copy additional branches from the parent repository, you can do so from the Branches page.

关于Git_GitHub Fork only master branch of a repo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61246036/

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