Code and repositories / Repository settings
Start a repository with a .gitignore and a license
A new repository needs a .gitignore and a license before the first push. When you create the repository, pick both, and its first commit has them.
2 min read
1. Open New repository
Open New repository.
Note
The template fields show only when Import from GitHub is off.
2. Pick a .gitignore template
In .gitignore template, pick a template, for example Node. Under the field, the form shows the patterns of the template.
3. Pick a license
In License, pick a license, for example MIT License. Under the field, the form shows what the license Permits, Requires and Forbids.
4. Create the repository
Click Create repository.
Create it in a terminal
src repo license list
src repo create acme/api --private --gitignore Node --license mit
src repo gitignore listlists the template names. A name is case-sensitive:Node, notnode.src repo license listlists the license keys, likemitorapache-2.0.
Done
The first commit of the new repository has the .gitignore and a LICENSE file. The LICENSE has the current year and the name of the owner.
With REST or MCP
POST /api/v1/repos, withgitignoreandlicense, creates the repository. The MCP tool iscreate_repo.GET /api/v1/gitignore/templatesandGET /api/v1/licenseslist the templates.
To ask for the facts that you need in each new issue, see Get complete issues with templates and forms.