skip to Main Content

I’m trying to create a pull request template for a branch in Azure DevOps with the Features/Project_foo name.

The default branch for the repository is master, in which I’ve created a folder called .azuredevops/pull_request_template/branches, which follows the guidance in the documentation:

https://learn.microsoft.com/en-us/azure/devops/repos/git/pull-request-templates?view=azure-devops

I’m unable to create an .md file called Features/Project_foo.md due to forward slashes not being allowed in file names.

Creating a PR template for all branches in the ‘Features’ folder with a file named ‘Features.md’ is possible. However, I only want to create a PR template for the Features/Project_foo branch.

Does Azure DevOps support pull request templates for specific branches in a folder?

2

Answers


  1. You may be confusing branches with subfolders. A branch is a direct replica of its origin at the point of creation. Once created, it is effectively its own repo (kind of).

    If you’re just wanting to create the readme in a subfolder, you need to navigate to the subfolder first, then select add file. If the folder doesn’t exist then create it first. Then you just give it a name – no need for the slash or subfolder name.

    If you have a separate branch then this should be displayed in the dropdown at the top left of your first screenshot. Switch to the branch first, then complete the steps above.

    Login or Signup to reply.
  2. Does Azure DevOps support pull request templates for specific branches in a folder?

    Yes, it’s supported.

    The error has indicated the file name Features/Project_foo.md is invalid due to it contains /. It’s not related to your real issue,but if you would like the file under Features folder, don’t rename existing file with /, but need to create a new file with the content.

    To create a PR template for the Features/Project_foo branch, you should create the Features.md named template, not Features/Project_foo.md. Please check the doc below:

    enter image description here

    My template, please put it in default branch.

    enter image description here

    Template is used when creating PR to target Features/Project_foo branch:

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search