Unfork a Github fork without deleting
Na, na. Github is far more powerful than you think.
Undoubtedly, there's no way but make a bare copy of all of the codes. However, the copy procedure can be done by Github itself. So, no pain of mirroring the code with our own bandwidth.
Step by step:
- Click the "+" on top right corner, select "Import repository"
- Paste the old repo url (like https://github.com/user/repo) and enter a new name.
- Click "Begin import"
Done. Github will even give you an email notification when copy'n'paste is done.
Tested to work against my own project. Good feature isn't it?
This method will create a new "unforked" repository while maintaining everything else (commit history, branches and tags).
How to "unfork" a project in four easy steps:
git clone --bare https://github.com/{username}/{repository}
- Delete original repository in
https://github.com/{username}/{repository}
/settings. - Create new repository with the name
{repository}
at https://github.com/new. -
cd {repository}.git
andgit push --mirror https://github.com/{username}/{repository}
And done!