-1

I want to squash the last 25 commits into one commit, so I did this:

git reset --soft HEAD~25
git commit -m "main refactor"

I have squashed the commits and added to one commit but I wanted it to remove or hide all contributions from a foreign contributor.

All foreign contribution have been joined into one commit as a commit from branch owner but it still keeps record of commits made by foreign contributor. How can I remove or hide the commits from the contributor?

By the way, I merged the contributor's commit some time ago.

Rory O'Kane
  • 29,210
  • 11
  • 96
  • 131
valen ezu
  • 113
  • 1
  • 9

1 Answers1

1

Try running this on a branch with all 25 non-squashed commits:

git rebase --interactive HEAD~25

In the text file that pops up, change pick to squash for the commits you want to be squashed, and change pick to drop for the commits by another contributor that you don’t want to keep. Then save and close the text file to do those listed steps.

Note that this will modify the branch you are on. If you still want to be able to access the 25 non-squashed commits after this, create a backup branch first.

Rory O'Kane
  • 29,210
  • 11
  • 96
  • 131