docs
docs copied to clipboard
"Transferring a repository" could mention something about forking back after transfering
Code of Conduct
- [X] I have read and agree to the GitHub Docs project's Code of Conduct
What article on docs.github.com is affected?
https://docs.github.com/en/repositories/creating-and-managing-repositories/transferring-a-repository
What part(s) of the article would you like to see updated?
I've already transferred a repository. The documentation states "All links to the previous repository location are automatically redirected to the new location.", which is working great. However, now I would like to know if I can create a fork back to the original account, without destroying those redirects.
Intuitively I would think, that the redirects will be lost entirely, when I would simply fork the repository, but it would be helpful if the docs could confirm this.
As a workaround to this, I am thinking about forking to a temporary account first, then renaming the repository (since it doesn't seem possible to rename while forking), and then transferring the renamed repository to the original account. Before I do this I would like to be sure that the redirects will keep working for the original name, and I think similarly it would be helpful if the docs could include some information about this.
Additional information
Content plan
Check out the content plan for guidance.
Thanks for opening this issue. A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.
@bjorn Thanks so much for opening an issue! I'll triage this for the team to take a look :eyes:
Hi @bjorn! These are great questions. Could you please reach out to the Community Forum to find out the answers? We'd then be happy to document that information. I'll close this issue for now, but feel free to re-open once we have that information to act on.
Hi @bjorn! These are great questions. Could you please reach out to the Community Forum to find out the answers? We'd then be happy to document that information.
Rather than starting another topic, I've decided to just give it a try. I did the following:
- (Transfer the repository
bjorn/tiled
tomapeditor/tiled
, which created redirects) - Fork
mapeditor/tiled
tomana/tiled
- Rename the
mana/tiled
repository tomana/tiled-dev
- Transfer the repository to
bjorn/tiled-dev
And I was glad to see, that this way, the redirects from bjorn/tiled
to mapeditor/tiled
remained intact!
Since there is no way to rename while forking, and forking back with the same name would replace the redirects, I think it would be worthwhile to add a section about these steps to the documentation.
Hi @bjorn :wave: Thanks for following up. I agree it would be helpful to provide some more information about redirects. Rather than explaining the very specific case of forking back after transferring, let's instead explain that:
- Redirects will function until a new repository or fork with the same name is created.
- Renaming or deleting the repository or fork will reinstate the redirect.
I think the best place to mention that would be in this bullet point, beneath the codeblock demonstrating how to update a remote:
https://github.com/github/docs/blob/main/content/repositories/creating-and-managing-repositories/transferring-a-repository.md?plain=1#L48-L53
Be careful to keep the indentation so the new information is contained in the same bullet point.
You or anyone else is welcome to open a PR to address this! :tada:
- Renaming or deleting the repository or fork will reinstate the redirect.
Do you mean that, when a repo was previously moved from a/foo
to b/foo
, then forked back to a/foo
, disabling the redirect, and then renamed to a/bar
, will reinstate the redirect from a/foo
to b/foo
, rather than setting up a new redirect from a/foo
to a/bar
?
@bjorn That's right. The redirect is created when the repository is moved. The redirect isn't deleted but it can be overridden. When you visit a/foo
, the site will first check for a repository/fork with that name and when it can't find one, it will check for redirects.
In your example, once a/foo
is renamed to a/bar
, the redirect starts working again. I hope that's helpful!
I'd like to work on this issue if possible @cmwilson21.
@CBID2 Thanks for your interest in picking this up! You, or anyone else, are welcome to submit a PR against this issue! 👍 🚀