3

So one of my repositories was originally forked from someone else's forgotten project; it has now gotten to the point where the code is literally 100% my own code and is unrecognizable in comparison to the original project.

My question is, is it possible to separate the fork from my current project, while keeping the commit history?

2
  • You mean forked on GitHub, and you want your fork to be a source repo instead of a fork? I don't think that's possible in GitHub. Not only that, but if the person you forked from had a software license, then you might still be bound to the terms of that license, even if you're made significant modifications to the code. Depends on the license though. Commented Jul 17, 2014 at 0:24
  • The license is MIT, but the project and it's code are now completely different and is all of my own code (means the license no longer applies). The license would matter if his code was still significant in some way, but since his code simply no longer exists within the project, there is nothing for the license to apply to. Beyond that, the only reason I want to separate the projects is to help avoid confusion. Commented Jul 17, 2014 at 0:34

1 Answer 1

3

You have (at least) 2 options:

  1. Ask GitHub support to drop the link between the source repo and yours. There's no UI for this, but they can do it for you. I had to do this myself once.
  2. Recreate the repo

Recreating the repo is easy enough:

  1. Update your local clone: git fetch origin
  2. Checkout remote branches you care about
    • Or checkout all remote branches: git branch -r | grep -v HEAD | while read b; do git checkout $(basename $b); done
  3. Rename the repo on GitHub, for example to repo-bak
  4. Create a new repo on GitHub with the original name
  5. Push all your local branches: git push origin --all
  6. Push tags: git push origin --tags
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks a lot, I ended up renaming the original repo (to keep history) and just made a new repo under the old name. But it's good to know that Github staff will do this. =)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.