1

I have started a project as a fork of a CMS/framework that's intended to fork when you build on top of it. Lets say it has 500 commits and I don't want to keep that history for my project.

Ideally I want to squash the first 499 commits, keep the 500th as a pivot if I decide to cherry pick a range of patches after that. I have my commits on top of it but still pull patches occasionally.

My ~50 commits are already on top of the first 500 in my fork.

Would that be possible? How would I squash the first commits? I'd also consider other option, if there is better way to achieve what I hope for.

ddinchev
  • 33,683
  • 28
  • 88
  • 133

1 Answers1

0

You can keep your fork as is, but also report your 50 commits on top of a new Git repo.

That new repo would be a clone of the original repo, in which you delete the .git (after cloning), and make a new git repo in it (git init .; git add -A .; git commit -m "one big commit")

Then you can start importing the 50 commits from your first repo to this new one: see "git: Apply changes introduced by commit in one repo to another repo".
I would use git format-patch as in this answer.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250