Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to (auto)-configure repository/project scaffold Azure DevOps/GitHub?

This is what I want to do, as soon as someone in your org create a repository in Azure DevOps (or GitHub), a defined project scaffold/structure is build for them. For example, a fresh repo (my_proj) is created, then DevOps/GitHub creates such a folder structure for you (you defined it somewhere):

───my_proj
   │   ReadMe.md
   │
   ├───docs
   ├───res
   │   ├───file
   │   └───img
   ├───scr
   └───tests

I know you can do these things after you clone the repo using some codes/libraries, but is there a way to do it automatically?

like image 594
mas Avatar asked Jan 19 '26 14:01

mas


1 Answers

As mentioned in "Create template git-repo in in azure devops", there is no native feature allowing you to chose a given Git repository template when initializing a new Project with Azure DevOps.

That means you could:

  • clone a template repository (created in advance on Azure DevOps=
  • push it back to your new empty Azure DevOp repository (by changing its URL with git remote set-url ...)

You can see that approach atomated through Azure piplines with "Create a new repository from a template in Azure DevOps" from Stephen Allwright

  1. Create a repository in Azure DevOps that you would like to use as your template. Let's call it 'project-template'
  2. Create a second repository to contain the build pipeline you will create. We will call this 'utilities'. This is a useful repository to have in general to house all your automation pipelines and other functions which improve the ease of development
  3. Create a starter build pipeline and host it within the utilities repository
  4. Create a variable within the pipeline UI called 'project-name', this will be used as the name of your newly created repository. Defining this variable within the UI allows us to choose a project name when we run the pipeline in DevOps
  5. Use the following code, making sure to replace 'devops-organisation', 'devops-project', 'email', and 'user' with your own values
like image 129
VonC Avatar answered Jan 22 '26 03:01

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!