Home > other >  How to specify --gitignore argument in gh repo create cli command?
How to specify --gitignore argument in gh repo create cli command?

Time:11-01

I'm trying to create remote repository using GitHub CLI and I can not find how to specify a particular gitignore file with argument --gitignore, say, github/gitignore/C .gitignore. There is an error HTTP 422: Repository creation failed. (https://api.github.com/user/repos) gitignore_template is an unknown gitignore template.

Unsuccessfully have been trying to find an example on internet and stackoverflow also.

CodePudding user response:

This feature was implemented with PR 3746 for gh v1.12.0 (Q2 2021).

It is supposed to use only one word for the gitignore parameter.
Example:

gh repo create random --gitignore Go --license mit --public --confirm 

In your case, try --gitignore C or --gitignore Cpp.

  • Related