gitgithubgit-rebase

Can GitHub "rebase and merge" autosquash fixup commits?


When GitHub uses the "rebase and merge" strategy when merging PRs, will it autosquash fixup commits?

I'm updating a PR on an open-source GitHub repo in response to code review. To make it easier for maintainers, I'd like to push separate commits including only the specific changes I made in response to review feedback. But the PR intentionally has separate commits that shouldn't be squashed when the PR is eventually merged. (I know the maintainers well and they prefer separate commits for logically separate parts of a PR.)

If I were merging locally, I could use git commit --fixup and git rebase -i --autosquash to squash the fixup commits before merging the feature branch.

Will GitHub's "Rebase and Merge" button also autosquash my fixup commits?

I'm assuming that the answer is "no", but I wanted to check before I autosquashed locally and force-pushed the PR branch.


Solution

  • No, GitHub's "rebase and merge" does not autosquash fixup commits.

    See feature request https://github.com/orgs/community/discussions/40804.