I have 2 branches … Production and Staging and they are very identical … i always make the
Squash and Merge Option to merge commits from Staging for example 4 commits … squashed them to production into 1 commit and merge using Github … but i don’t know how to solve this … every time i make a new PR from
staging to production it shows
n commits with no file changes … while the opposite (
Production to Staging) shows this message (
There isn't anything to compare)
How can i get rid of those commits with 0 files changes … all i do is fetch and rebase staging from production
Squash and Merge option creates a new commit on the target branch, which changes its history. This is why you’ll always see the
there isn't anything to compare or
<n> commits with no file changes messages when comparing two otherwise identical branches.
If possible, I’d suggest using the regular
Merge action over
Squash and Merge when merging Pull Requests, as that will keep the history of the two branches identical and prevent this issue going forward.
Answered By – Adil B