Not able to exclude files from PR

Mugdha Hardikar November 6, 2023

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. 

1 answer

1 accepted

0 votes
Answer accepted
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 7, 2023

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

Mugdha Hardikar November 7, 2023

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.

Mugdha Hardikar November 7, 2023

I think I got what needs to be done. Thanks a lot for all the support.

Like Patrik S likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events