I have a complex GitFlow structure, where I am using a Sprint branch for integration prior to merging into the main branch, while the Sprint is active. The workflow is:
- At the start of a Sprint, we create a branch for it, let's say Sprint-33 from main HEAD.
- When we create a topic branch from a Jira issue, it is based on the Sprint-33 HEAD. That part works file.
- Commits happen and are pushed to the topic branch.
- When delivering we create a Pull Request. First, the web page for the pull request shows a merge from topic to main, not Sprint-33, which would be preferable.
- When I change the destination branch to Sprint-33, the commits being merged change, but still include previously merged commits that are already on Sprint-33 not topic. This is a bug that needs to be fixed because the pull request content is wrong. It should just contain commits from topic., not from Sprint-33 and not from main.
- We use merge squash for merging from topic to Sprint-33 and regular merges from Sprint-33 to main. That part works fine.
This happens regardless of whether a previous pull request was declined or not.