0

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:

  1. 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 and master together.
  2. 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.
  3. Since I don't have hundreds of commits in my project, I suppose I could also just git format-patch my 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?
ludwig_de
  • 1
  • 1

0 Answers0