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.
2
Answers
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.
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:
My template, please put it in default branch.
Template is used when creating PR to target Features/Project_foo branch: