Module 2 · Git & GitHub for Beginners
Your First Repository
Create a repository on GitHub, add and edit files, and write good commit messages, all in your browser with nothing to install.
About 25 minutes
Start in the browser
You don't need to install anything to start. GitHub lets you create repositories and commit changes on the website. (Later you can install GitHub Desktop or use Git on the command line.)
Create a repository
- On GitHub, click + (top right) → New repository.
- Repository name: short and clear, with hyphens, such as
sales-analysisormy-first-website. - Description: one sentence on what it is.
- Choose Public (anyone can see it, which is good for a portfolio) or Private.
- Tick Add a README file.
- Click Create repository.
Add and edit files
- Add a file: click Add file → Create new file, type a name such as
notes.md, write something, then scroll down. - Upload files: click Add file → Upload files and drag in your work, for example a spreadsheet, a notebook or images.
- Edit a file: open it and click the pencil icon.
Each time, GitHub asks you to commit changes. That's your save point.
Write good commit messages
A commit message says what changed. Future you (and anyone reviewing your work) will read these.
| Weak | Strong |
|---|---|
| update | Add revenue by region chart |
| stuff | Fix date format in orders data |
| final | Write README with project summary |
Start with a verb (Add, Fix, Update, Remove) and keep it under about 60 characters.
See the history
Click Commits (near the top of the file list, with a clock icon) to see every change, who made it and when. Click any commit to see exactly what changed: removed lines in red, added lines in green.
Try it
- Create a public repository called
learning-logwith a README. - Add a file called
week-1.mdand write three things you learned this week. - Commit it with a clear message such as "Add week 1 learning notes".
- Edit the README to say what the repository is for, and commit again.
- Open the commit history and look at what changed.
Earn your badge
Take the module check
Five quick questions about this module. Pass and you earn the First Repository badge, free.
Create a free account to earn the badge