Automate creation of repository and branches #21775
-
I would like to know, is there any possibility of automated scripts, which will help us to setup the Repository and branches specified? git_repo_setup.properties:repo=MyProject
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
Hi @vamshidharkibm, Thank you for being here! It is possible to automate the creation of repositories by using one of the two Depending on your use case, you may also find webhooks useful. For instance, you could use a webhook to create a new repository whenever an issue is created requesting one. |
Beta Was this translation helpful? Give feedback.
-
Thank you @andreagriffiths11 I’m new to REST APIs; Can anyone provide a way how can I use them? Can I use them from a Java Program or does it work only shell script? Is there any sample code snippet? Below is what I tried from Terminal, but branch is not created curl -i -H “Authorization: token <my_token>” \ Thanks Vamshi |
Beta Was this translation helpful? Give feedback.
-
Hi, I’m able to use it in the following way curl -u $gitUserName https://api.github.com/user/repos -d “{“name”:”$repoName"}" Thanks Vamshi |
Beta Was this translation helpful? Give feedback.
-
Hi, The below command from the shell script is working fine on my Red Hat Enterprise Linux. But the same does not work from the git bash env. on a Windows system. The control hangs at this line from the shell script. What could be the issue? curl -u $gitUserName https://api.github.com/user/repos -d “{“name”:”$repoName"}" Thanks Vamshi |
Beta Was this translation helpful? Give feedback.
-
It works now with the following winpty curl Thanks Vamshi |
Beta Was this translation helpful? Give feedback.
Hi @vamshidharkibm,
Thank you for being here! It is possible to automate the creation of repositories by using one of the two
create
API end points.Depending on your use case, you may also find webhooks useful. For instance, you could use a webhook to create a new repository whenever an issue is created requesting one.