I merged an upstream of a large project with my local git repo. Prior to the merge I had a small amount of history that was easy to read through, but after the merge a massi
The solution I ended up using was to manually recreate the history. I did this mainly because I didn't want to spend too much time looking for an elegant solution and there wasn't that much history (around 30 commits I'd have to manually merge).
So, I created a branch before I merged the huge upstream:
git checkout -b remove-history-fix
Then re-merged the upstream using the --squash option.
git merge --squash
Then manually cherry-picked the commits after the merge from the old branch (the one with the huge amount of upstream history).
git cherry-pick
After all those commits were merged into my remove-history-fix branch, I removed the branch with the upstream history.
git branch -D