I have a branch with around 10 commits. 3 of these are merge commits merging master to my branch and adding ~500 commits in between each time. Is there a way to squash commits that were made on the current branch in one? my history looks something like this:
ad54ef86 My Commit 1
ad54ef86 Merge commit
ad54ef86 Others' Commits
....500 more others' commits
ad54ef86 My Commit 2
ad54ef86 My Commit 3
ad54ef86 Merge commit
ad54ef86 Others' Commits
....500 more others' commits
ad54ef86 My Commit 4
...
Now doing git rebase -i HEAD~2000
and searching is a lot of work. It there a way around it?
EDIT: So this question is being tagged as a duplicate of Squashing last n commits together. That is clearly not my problem. I want to squash the last n commits made ONLY on my current branch AFTER I merge another branch in this branch and get all those commits in the way as well.