Create your first GitHub repository (with README, .gitignore & license)

Your journey into GitHub starts with one button: "New repository". This guide walks you through every choice — README, .gitignore, license — and shows how to clone it to your computer.

Your computer (local)GitHub (remote)

1 Sign in & start a new repository

Go to github.com and sign in. In the top‑right corner, click the plus icon and select "New repository" (or use the green "New" button on your repositories page).

Tip: If you don't have an account yet, create one – it's free. You'll need to verify your email.
2 Repository name & description

Repository name

Choose a short, descriptive name (e.g., my-first-project). Use hyphens instead of spaces.

Description (optional)

Explain what your project is about. It helps others understand your repo at a glance.

Public or Private? Public = anyone can see it (great for open source). Private = only you and invited collaborators.

3 Initialize with: README · .gitignore · license

This is where most beginners get confused – but it's super useful. You can check these boxes to auto‑generate essential files.

README.md

A README is the front page of your repository. It usually contains: project title, description, how to install/use, and examples. GitHub shows it directly on your repo home page. Always a good idea to add it!

# My First Project This is my first GitHub repo. I'm learning how to use Git and GitHub. ## Installation `npm install my-project`

.gitignore

A .gitignore file tells Git which files not to track (e.g., temporary files, node_modules, API keys, IDE settings). GitHub offers templates for different languages (Python, Node, Java, etc.).

If you pick a template, it automatically creates a .gitignore with common patterns for that language.

License

A license tells others what they can and cannot do with your code. For public repos, it's essential. Common choices:

  • MIT – very permissive, allows anyone to do anything as long as they include the original copyright.
  • GPL – requires derivative works to also be open source.
  • Apache 2.0 – similar to MIT but includes patent protection.

👉 If unsure, pick MIT – it's simple and widely used.

Important: If you check these boxes, GitHub creates the files for you. If you don't, you'll have an empty repo – you can still add them later with Git commands.
4 Click "Create repository"

After filling in the details, click the green "Create repository" button. Congratulations – your first GitHub repo is born! 🎉

You'll be redirected to your new repository page. If you added README, you'll see it displayed. The URL will be something like: https://github.com/your-username/repo-name

5 Clone your repository (bring it to your computer)

Cloning means downloading your repo from GitHub to your local machine so you can work on it. You'll need Git installed (git --version to check).

On your repo page, click the green "Code" button. Copy the HTTPS URL (e.g., https://github.com/yourname/repo.git).

Open a terminal (command prompt) and run:

git clone https://github.com/yourname/repo.git

This creates a folder named repo on your computer, with all the files (README, .gitignore, license) inside. Now you can edit, add files, commit changes, and push them back.

After cloning, try cd repo and git status to see that you're inside a Git repository.
+ Bonus: first push (if you didn't initialize with README)

If you created an empty repository (without README), GitHub shows instructions. In your local folder, after adding some files, you'd run:

git init git add . git commit -m "first commit" git branch -M main git remote add origin https://github.com/yourname/repo.git git push -u origin main

Now your local code appears on GitHub.

What we covered – quick recap

  • README.md – project front page, write in Markdown.
  • .gitignore – exclude unnecessary files, use templates.
  • License – protect your code (MIT, GPL, etc.)
  • Clonegit clone <url> brings repo to your machine.
Git basics for GitHub Back: What is GitHub? Next: Branches on GitHub

📘 Now you have a real GitHub repo. Time to start coding and committing!