I have 2 branches. main
and deploy
. I keep committing changes to the main
branch, and when it's the time to deploy, I raise a PR to deploy
from main
and squash all commits for a cleaner commit history in the deploy branch, it helps to track changes that went in a release, and in the worst case it could be reverted easily as it goes as a single commit.
The issue is that whenever I raise a new PR from main
to deploy
, it doesn't account for the already merged changes. It shows the old commits again in the PR. I somehow understand the issue as the exact commit hash isn't available in the deploy
branch. But how can I avoid this while keeping the deploy
branch clean? Are there alternatives to achieve the same?