I am trying to find out how to squash commits in Git from a range of commits. My specific situation is that I forked a repository and added several commits of work on top of it; however I'd like to squash all of the forked repo's commits to a single commit to keep the history clean.
Example
7e8d7f7 - (HEAD) My commit
809fc8b - My commit
e04692c - Forked repo's commit          \
2674323 - Forked repo's commit           > Turn these into a single commit
4e79731 - Forked repo's initial commit  /
Here's something I've tried
- Get the SHA for the initial commit via git rev-list --max-parents=0 HEADfor the lower bound of the range I want to squash (Source)
- Detach the HEAD to the upper bound of the range via git checkout <upper bound commit>
- Soft reset to the lower bound and commit (alternative to git rebase -i):git reset --soft <lower bound commit> && git commit(Source)
- Merge into master:git merge --no-ff master
I end up getting tons of merge conflicts this way. I feel that what I'm trying to achieve is possible with the commands I've encountered, but I'm at a loss at how to string them together to make it work.
 
     
     
    