Delete fork dependency of a GitHub repository

Make sure you have all the important branches and tags on your local repo, delete the github repo, recreate the repository through usual means (no forking) and push the local repository back with git push --all. Note that if you have local branches that you don't want to publish, might be worth to create a temporary clean local clone for the operation.

However, this will also get rid of wiki and issues. As the wiki is in fact it's own repository, it can be handled similarly by cloning it and then recreating and pushing. The repo address is on wiki's Git Access page ([email protected]:user/repo.wiki.git).

This leaves issues. They can be exported through the API, but as far as I know, you can only create issues and comments with your person, so importing them perfectly is impossible.

So, if you need issues to be preserved, you should go through github support as Thomas Moulard suggests.


You could duplicate the forked repository to a new repository (without the fork dependency) from the GitHub UI, then remove the original forked one:

  • Sign in to GitHub
  • Select the + sign in the top right corner and select Import repository.
  • Import your forked repository. The new repository won't have the fork dependency.
  • Delete the original, forked repository in the repository settings.

NOTE: This approach will not preserve issues and pull requests.


You can contact github support and ask them to switch your repository to "normal mode".

On this page, "Commit was made in a fork" paragraph, it is explained that one has to go through support to switch. Therefore, it is likely that there is no way to do that by yourself (unless you destroy and recreate your repo which is explained before... if you do so be careful if you have tickets or a wiki attached to your project as they will be deleted!).

Update Jan 2022:

Use the GitHub chatbot-virtual-assistant at https://support.github.com/request/fork .

Tags:

Github