How can I make GitHub forget or disassociate that my repo was originally a fork of another project?
I forked a project in GitHub. I can now see \"forked from whateve
You could duplicate the forked repository to a new repository (without the fork depencency) from the github UI, then remove the original forked one:
Using the info from aurelien and Clayton, I was able to do this with the following:
$ git clone --bare https://github.com/my/forked_repo.git
<delete forked_repo on GitHub>
<recreate repo on GitHub using same name>
$ cd forked_repo.git
$ git push --mirror
Here's the documentation for git clone --bare:
Make a bare Git repository. That is, instead of creating
<directory>
and placing the administrative files in<directory>/.git
, make the<directory>
itself the$GIT_DIR
. This obviously implies the -n because there is nowhere to check out the working tree. Also the branch heads at the remote are copied directly to corresponding local branch heads, without mapping them torefs/remotes/origin/
. When this option is used, neither remote-tracking branches nor the related configuration variables are created.
Here's the documentation for git push --mirror:
Instead of naming each ref to push, specifies that all refs under
refs/
(which includes but is not limited torefs/heads/
,refs/remotes/
, andrefs/tags/
) be mirrored to the remote repository. Newly created local refs will be pushed to the remote end, locally updated refs will be force updated on the remote end, and deleted refs will be removed from the remote end. This is the default if the configuration optionremote.<remote>.mirror
is set.
Note: like the other git
based answers, this will not copy over issues that are not part of the git
repo such as the wiki and issues. Per Tapio:
git@github.com:user/repo.wiki.git
.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!).
This only applies to GitHub Enterprise, not on github.com
Logged in to an account that has admin privileges:
https://<ghe url>/<org>/<repo>
This was tested on GitHub Enterprise 2.9
I got the similar problem, and ended up using this github help page to solve it. I didn't mind about the wiki and issues tracker as it was for my blog using a theme kindly developed by another user.
To detach a forked repo and use it as your own after several commits without losing the whole history:
git clone --bare git@github.com:user/forked_repo.git
Create a new empty reposity new-repository
on the github website.
And push a mirrored version:
cd user.github.com.git/
git push --mirror git@github.com:user/new-repository.git
One can rename on github, the forked_repository
with another name to keep it as backup and check updates if needed. Or simply delete it.
Renaming the new-repository
to the original name does the job. As a side effect, your commits now appear in your history.
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 (git@github.com: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.