If I fork open-source repository A on GitHub and rename it to B via the Settings tab
Alternative, since Apr. 2022:
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.
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"
.