Your repository on GitHub · lesson 2 of 9
Commands and ideas in this lesson
ANew repositoryowner, name, visibility, starting files
BLicencewhat others may do with it
CREADME.mdthe front page, in Markdown
D.gitignorefrom lesson 1.6

Creating a repository

Last updated

You don't need a terminal to start a repository on GitHub. In this lesson you'll make one on the website, choose who can see it and what it starts with, pick a licence, and write the README that greets every visitor. Lesson 4.3 then fills it with files.

By the end of this lesson you can

  • Create a repository on GitHub, choosing public or private
  • Decide whether it starts with a README, .gitignore and licence, or starts empty
  • Choose a licence, and write a README in Markdown

The new-repository form

On GitHub, the + menu at the top has New repository. It opens a short form.

  1. Owner and name. Your account, or an organisation you belong to, and a short name. Together they make the address: github.com/ana-reyes/kusina-trial.
  2. Description. One line, shown in the About box. Optional, and easy to change later.
  3. Public or private. Who can see it. You can change this later in Settings, but anything that was public may already have been copied.
  4. Add a README. Starts the repository with one commit holding README.md. See step 2 for when to leave it off.
  5. .gitignore template. A starting .gitignore for a language or tool (lesson 1.6), such as Python’s.
  6. Licence. A LICENSE file saying what others may do with your work. Step 3 explains.
  7. Create repository. Makes it. The repository is a Git repository like yours, kept on GitHub’s computers.
GitHub’s new-repository form. The course’s own drawing of this GitHub screen, with GitHub’s names for each part. A screenshot from the course’s demo account will replace it.

Start with files, or start empty

Ticking Add a README, a .gitignore or a licence makes GitHub create a first commit for you. That's right when the project starts on GitHub: you'll upload files (lesson 4.3), edit in the browser (lesson 4.4), or clone it to your computer.

Leave all three off when the project already exists on your computer, like Ana's Kusina from Stages 1–3. Then the repository starts empty, with no commits, and lesson 4.8 pushes Kusina's whole history into it. A README made on GitHub would be a first commit Kusina doesn't have, and the first push would be rejected (lesson 4.7 explains why).

Choosing a licence

With no licence, others may read your work but not reuse it: the law's default is "all rights reserved". The licence menu offers the common ones:

  • MIT: do almost anything, as long as the licence notice stays. Common for small code projects.
  • Apache 2.0: like MIT, with extra wording about patents.
  • GPL 3.0: share it, but changed versions must be shared under the GPL too.

Recipes and writing usually use a Creative Commons licence instead, such as CC BY 4.0 ("reuse it, and say who made it"). It isn't in GitHub's menu: add it as a LICENSE file you upload (lesson 4.3).

0 of 4 placed right

  1. Kusina’s recipes, which the family wants shared as long as Lola Remy is credited

  2. Joaquin’s small script that builds the index page; he doesn’t mind what anyone does with it

  3. A recipe app the family wants to stay open: anyone who changes and shares it must share their changes too

  4. Ana’s school essay, public so her teacher can read it, but not for anyone to copy

Writing the README

GitHub shows README.md under the file list: it's the first thing every visitor reads. Click its pencil to edit it in the browser. It's written in Markdown, plain text with a few marks:

# Kusina

Lola Remy's recipes, typed up from her notebook so the whole family can cook them.

## What's here

- **Mains:** adobo, sinigang, pancit
- **Desserts:** leche flan, in the `desserts` folder

## How to help

Found a mistake? [Open an issue](../../issues). Want to add a recipe? See `CONTRIBUTING.md`.

The recipes are shared under CC BY 4.0: see `LICENSE`.

# makes a heading, - a list item, **bold**, `code` for file names, and [text](address) a link. The Preview tab shows how it will look. A good README answers four questions: what is this, what's in it, how do I use it, and how can I help.

Spot the trap: public by accident

Spot the trapAna

Ana makes a repository for the family’s contact list, to keep it with the recipes. Public is already chosen on the form, and she presses Create.

What happens if…

Check what you learned

Ana already has Kusina, with its history, on her computer. How should she make its GitHub repository?
A public repository has no licence. What may others do with it?
In Markdown, what does a line starting with ## make?

Sources

Every command on this page behaves as these pages describe, and the sandbox prints what Git 2.55 prints. Hosting features (pull requests, protected branches) come from the host’s own documentation.

All sources for Simple Git