A few years ago I cloned a project from github, created my own branches and worked on those. I periodically pulled from the origin to master and merged master into my own branches to keep them up to date with the main project.
I now realize I should have forked from the main project. Is there a way to retroactively make my repository a fork?
What I have tried so far:
- Followed the instructions in Retroactively forking a project on github, forking the main repo and making it a remote of my own project, then merging with
git pull origin master --rebase. Unfortunately this seems to squash all of my branches andmastertogether. - Merged my repository into the new fork, following How do you merge two Git repositories? but this does not preserve the commit history, replacing it by one big merge commit.
- Since I don't have hundreds of commits in my project, I suppose I could also just
git format-patchmy commits one by one into the fork as git patches as in How can I generate a Git patch for a specific commit?. The end result would correspond to what I am looking for, but this seems like a very inelegant and time-consuming way to do it. Is there a better way to do what I want?