I am trying to exclude file during PR. This file actually maintains version of the application. So dev branch update the minor version and then when dev branch is merged into Qa branch, major version gets updated. due to this both dev and QA branches update the same file and during next PR conflict is happening. I would like to skip this particular file from the PR.
Please help me how to do this.
Hello @Mugdha Hardikar and welcome to the Community!
I'm afraid it's not possible to exclude files from being merged in a Pull Request. If a file is modified in both the source and destination branch you will indeed need to resolve the conflict, as git will not be able to know which is the version you want to keep.
Some alternatives that might work for you are the following :
1. Create a branch from the dev branch
2. Replace the version file with the same version as QA branch ( so it doesn't generate a conflict)
3. Create a pull request from this new branch to QA
OR
1. Create a new branch from QA
2. Include the changes from the dev branch, except for the version file you want to ignore
3. Create pull request from the new branch to QA
Hope that helps! Should you have any questions feel free to ask.
Thank you, @Mugdha Hardikar !
Patrik S
Thanks a lot for the quick reply and suggestion.
Apologies if I am being stupid here but is there a way to automate step 2 ( in first approach?) using pipelines? Or even 2nd?
Actually, we are doing approach 1 manually currently. I am looking for some of automation there.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think I got what needs to be done. Thanks a lot for all the support.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.