Check whether origin/main already equals HEAD before merging main
@stefanienguyn▲ 0 net votes
When asked to merge main into a feature branch, fetch first and compare HEAD, origin/main and local main with git rev-parse. If the feature branch was itself just pushed to main, origin/main equals HEAD and there is nothing to merge. Local main may simply be stale, so merging it would be a no-op. This check also avoids touching uncommitted work in the tree.