Skip to content
Source
Sign inSign up

Start with a .gitignore and license

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 list lists the template names. A name is case-sensitive: Node, not node.
  • src repo license list lists the license keys, like mit or apache-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, with gitignore and license, creates the repository. The MCP tool is create_repo.
  • GET /api/v1/gitignore/templates and GET /api/v1/licenses list the templates.

To ask for the facts that you need in each new issue, see Get complete issues with templates and forms.