While creating the GitHub Pull Request between the branches, it's taking the previous commit on the target branch instead of the latest one.
As a result, we are unable to complete the deployments, leading to a lot of manual changes on the branches to resolve the conflicts.
You need to make sure your feature branch is up-to-date with the target branch.
That should involve fetching the latest changes from the target branch and merging or rebasing your feature branch against it before creating or updating the PR.
If you encounter conflicts during the merge or rebase, you will need to resolve them manually, then continue the rebase (if you are rebasing) or commit the merge (if you are merging).
Push your changes to the feature branch on the remote repository. If you have rebased, you will need to use force push:
That will make sure your feature branch contains all the updates from the target branch, allowing for a cleaner and conflict-free PR.