...
- Open Terminal on the Mac and change directories to the repo/branch for the PR for which you are squashing commits.
Enter the command:
git rebase -i HEAD~3
where the number after the tilde is the number of commits for your branch. A Sublime window opens.- The top n lines in the file start with the word "pick", where n is that same number of commits. Skip the first line, and then change "pick" to "squash" or "s" on each subsequent line.
- Save the file. Another file opens.
- The descriptions you entered for each commit are listed at the top of the file. Delete all but one of them. Save the file.
- Return to Terminal and enter the command:
git push -f
The PR in Github will refresh to show only one commit, with the description that you chose in Step 5.