Imran
Imran

Reputation: 13468

What are the consequences of renaming a fork on GitHub?

If I fork open-source repository A on GitHub and rename it to B via the Settings tab will I still be able to:

  1. Merge later changes from A into B?
  2. Submit pull requests to A based on changes I have made to B?

Are there any other potential consequences of a rename that I haven't thought of?

Upvotes: 11

Views: 3388

Answers (2)

VonC
VonC

Reputation: 1329092

If I fork open-source repository A on GitHub and rename it to B via the Settings tab

Alternative, since Apr. 2022:

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.

New fork page -- https://i0.wp.com/user-images.githubusercontent.com/90000203/162800388-9c07b590-75c4-4a86-8042-6eddea94bb61.png?ssl=1

Read more about working with forks.

So... no need to rename it after fork.
The fork can directly be created with the right target name.

This is reflected in the CLI gh v2.14.0 with gh repo fork --fork-name new-fork".

Upvotes: 5

knittl
knittl

Reputation: 265864

Yes

you can rename your fork without losing the ability to create pull requests and merge changes. Just make sure that you update the URL of the remote in your local clones.

(I forked a project on GitHub, changed its name. Everything still works)

Upvotes: 5

Related Questions