I made a silly mistake and am not sure the best way to resolve it. Here's what I did:
My git history now has all of the boilerplate history before my first project commit that I initially had removed. It also has a hundreds of commits interspersed in the middle of my commits.
What I'd like to do is squash everything in the merge from upstream into the local branch I was using into a single commit. Is there a somewhat painless way to do this?
Also, I need to rewrite history on origin as well. This is a private repo and only a couple people are using it. How do I do this?
What I'd like to do is squash everything in the merge from upstream into the local branch I was using into a single commit. Is there a somewhat painless way to do this?
Use two local clone of your repo:
Then, from the second, you can git --work-tree=/path/to/first/clone add .
everything from the first, and commit.
Repeat for the various state of the first repo you want to squash into one commit (achieved in the second repo by adding the working tree of the first repo, and committing).
Then git push --force
.