Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in DevOps and Agile by (19.7k points)

How to un fork a Github repository?

I have never seen unfork option. Does anybody know how to do that?

closed

1 Answer

+1 vote
by (62.9k points)
selected by
 
Best answer

Currently, Github doesn't have an unfork option, so the only solution is to delete the forked repo.

Warning: The following solution will delete your cloned repo. If you want unfork without your repo is being deleted try the method shown at the end of this answer as “Note”

Step 1: Go to Settings of Repo you want to un fork

 

Step 2: Click Delete this Repository 

enter image description here

Step 3: Enter your name / Repo name

 

Step 4: Click "I understand the consequences, delete this repository" button

enter image description here

Note: This technique will create a new "unforked" repository while maintaining everything else (commit history, branches and tags).

How to "unfork" a project in four easy steps:

  1. git clone --bare https://github.com/{username}/{repository}

  2. Delete original repository in https://github.com/{username}/{repository}/settings.

  3. Create new repository with the name {repository} at https://github.com/new.

  4. cd {repository}.git and git push --mirror https://github.com/{username}/{repository}

If you wish to learn software version control and its hosting service then you can join GitHub training.

unfork github-how to unfork the github repository?
Intellipaat-community
by (19.7k points)
Thanks for the detailed explanation!
by
"while maintaining everything else (commit history, branches and tags)"
It will maintain only the mentioned git stuff but will lost github stuff (issue, wiki, release, description, repository settings, ...).

So careful if you have github valuable data on the forked repo with this method.

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...