0

I would like to add a file (readme.md) to a Bitbucket Server git repository when it is created. I am looking for suggestions on the best way to do this as well as any example code on how to accomplish it. I was looking at the following possibilities:

  1. Git pre/post hook
  2. Template file for git -init (Would this work when a user clicks the "Create Repository" in the Bitbucket GUI?)
  3. Bitbucket ScriptRunner listener

Thank you for any help!

Working on a script to add the files manually. Still in progress.

Jay
  • 27
  • 3

1 Answers1

1

If you do not mind a commercial app, another option could be our Repository Templates for Bitbucket.

Add common files like LICENSE.txt or CODEOWNERS to your template repository, and when you create a new repository, you can choose that template as a start and all the files will be copied over to the new repository.

Michael Rueegg
  • 765
  • 4
  • 13
  • Hello. Would the plugin clone other plugin settings to the new repo? Thanks. Planning to test it soon. – Jay May 12 '23 at 01:56
  • Yes, it also supports a wide range of settings it can sync to the new repository, e.g. branch permissions or hook settings. Please see the Marketplace listing for a list of supported setting types. – Michael Rueegg May 15 '23 at 06:22