在 GitHub 上重命名分叉会产生什么后果?
What are the consequences of renaming a fork on GitHub?
如果我在 GitHub 上 fork 开源存储库 A 并通过“设置”选项卡将其重命名为 B,我仍然能够:
- 将以后的更改从 A 合并到 B?
- 根据我对 B 所做的更改向 A 提交拉取请求?
重命名还有其他我没有想到的潜在后果吗?
是
您可以重命名您的复刻,而不会失去创建拉取请求和合并更改的能力。只需确保在本地克隆中更新遥控器的 URL。
(我在 GitHub 上分叉了一个项目,更改了它的名字。一切仍然有效)
If I fork open-source repository A on GitHub and rename it to B via the Settings tab
备选方案,自 2022 年 4 月起:
You can now name your fork when creating it
Previously, when you forked a repository the fork name would default to the same name as the parent repository.
In some cases, that wasn't ideal because you wanted the fork to have a different name.
Your only option was to rename the fork after it was created. Now you can customize the fork name at the same time you're creating it.
Read more about working with forks.
所以...fork 后无需重命名。
使用正确的目标名称可以直接创建分支。
如果我在 GitHub 上 fork 开源存储库 A 并通过“设置”选项卡将其重命名为 B,我仍然能够:
- 将以后的更改从 A 合并到 B?
- 根据我对 B 所做的更改向 A 提交拉取请求?
重命名还有其他我没有想到的潜在后果吗?
是
您可以重命名您的复刻,而不会失去创建拉取请求和合并更改的能力。只需确保在本地克隆中更新遥控器的 URL。
(我在 GitHub 上分叉了一个项目,更改了它的名字。一切仍然有效)
If I fork open-source repository A on GitHub and rename it to B via the Settings tab
备选方案,自 2022 年 4 月起:
You can now name your fork when creating it
Previously, when you forked a repository the fork name would default to the same name as the parent repository.
In some cases, that wasn't ideal because you wanted the fork to have a different name.
Your only option was to rename the fork after it was created. Now you can customize the fork name at the same time you're creating it.
Read more about working with forks.
所以...fork 后无需重命名。
使用正确的目标名称可以直接创建分支。