Rasika H
Rasika H

Reputation: 119

Exclude Files on a Pull Request on Azure DevOps

We are using Azure DevOps Repo as our code repository and there are 3 branches on there. They are Dev, UAT and master. When a developer needs to work on a feature, he/she creates a feature branch from Dev and then work on the feature branch. Once the development is completed, they merge the changes from the feature branch with Dev by creating a Pull Request. When the changes are ready for testing, we will merge Dev branch with UAT branch. At this time, we need to exclude some features, and we don't need to merge those into UAT. So, my question is how to do it on Azure DevOps Repo?

Upvotes: 7

Views: 17268

Answers (2)

Vito Liu
Vito Liu

Reputation: 8298

Exclude Files on a Pull Request on Azure DevOps

Indeed, there is no way to simply exclude source controlled files from Pull Request.

As a workaround, we could refer to this doc to configure .gitignore and .git/info/exclude file to ignore file changes.

Ignore files in your Git repo: We could share .gitignore file with team members and push to the Git repo. To exclude files only on your system, edit the .git/info/exclude file in your local repo. Changes to this file aren't shared with others. They apply only to the files in that repo. The syntax for this file is the same as the one used in .gitignore.

In addition, I found a feature request, you could vote and follow the suggestion ticket.

Upvotes: 0

Shamrai Aleksander
Shamrai Aleksander

Reputation: 16018

You can not do that. In this case, you need to change your merge strategy from feature->Dev->Uat->master to feature->Dev;feature->Uat;feature->master. However, this way is too complex to support and manage which features were merged and which were not.

Upvotes: 1

Related Questions