I have setup my build tool on different Git branches. e.g. develop, QA, stage, prod. code pushed in develop will build and deploy to develop environment and similar for other Git branches. So code changes are first pushed to develop. after dev verification, develop branch is merged with QA and so on.
The problem I am trying to solve is that I have environment specific configuration files that should not move to next branch on merge. So currently if I make change in dev specific setting file, and commit to develop branch. When develop branch is merged with QA branch, the settings changes are passed to QA also.
How to skip merging files or folder in git branch merge.