Commits in master branch exist in lower branches in the pipeline.If you look at the commit history in one of the lower branches of your pipeline, you might see commits related to user stories that were deployed to production or commits related to backups that were made in the master branch. This is expected.
When branches are merged in git, the commit history of the branches is also merged. This is standard git behaviour. If a feature branch from a user story is merged into the branch of the source environment during the commit or into the promotion branch and target branch during a deployment, the commit history of the feature branch will be also merged.
Whenever a commit is made on a user story and a feature branch is created from master, the branch of the source environment of the user story should already contain all the commits that are present in the master branch. If some of the commits in the feature branch are not present in branch of the source environment of the user story, this means that:
1. Full Snapshots (Backups) were made on the master branch.
2. User Stories deployed to production were not back promoted to all the lower environments in the pipeline and therefore the master branch contains commits that were never back promoted and merged to the lower environment and branches.
Backups should never been made in branches that are part of your pipeline. If you need to make backups, you should create backups branches and git snapshot record in Copado for these specific branches. The backup branches can belong to the same git repository but they cannot be part of your pipeline.
You should also back promote to the lower environments the user stories that are moved to production so that the lower environments and their branches are up to date with the changes (and commits) that were moved to production (and master branch). This way, when the feature branch created from master is merged into the branch of the source environment of the user story, you will not introduce in the branch of the environment changes and commits that don't exist in the environment.