Learn Git and the Terminal
Guide: How to Learn Git for Beginners: Init, Add, Commit, Branch and MergeA small course in 8 short lessons on the terminal and on the basics of Git, the tool that remembers the versions of your files. You type in a practice terminal that runs in your browser: you find your way around with pwd, ls and cd, make a file, start a repository with git init, choose changes with git add, save them with git commit, read the history with git log and work on a branch that you merge back. Your own files are never touched. It is a small copy that knows only part of Git and of the terminal.
0 of 8 lessons done. Your progress is saved in this browser.
1. Find your way around
The terminal is a window where you type commands instead of clicking. The line ends with a $: that is where you type, then press Enter. The ~ in front of it means your home folder.
Two commands to start: pwd shows which folder you are in, and ls lists what is in that folder. Everything here is a small practice copy: nothing you type touches your own computer.
Your task: Run pwd and then ls.
Practice terminal
Type a command below and press Enter.
Goal: You ran pwd and ls✗
Commands this terminal knows
- pwd, ls, cd, mkdir, touch, cat, rm, clear
- echo "text" > file, echo "text" >> file
- git init, git status, git add, git commit -m
- git log, git log --oneline, git branch
- git switch, git switch -c, git merge
Use the arrow keys to bring back an earlier command.
This is a small practice copy that runs in your browser. It does not touch your own files and it knows only a small part of Git and of the terminal. Real Git has many more commands, such as push, pull and clone.
Features
- 8 short lessons, from pwd to merging a branch
- A practice terminal in your browser that never touches your own files
- A goal for every lesson that is checked as you type, plus a hint and the full answer
- Arrow keys bring back earlier commands
How to use Learn Git and the Terminal
- Read the lesson and the goal.
- Type commands in the practice terminal and press Enter.
- Watch the goal turn into a tick. Use the hint or the answer if you are stuck.
- Go to the next lesson.
Frequently asked questions
Is this real Git?
No. It is a small copy of Git and of the terminal that runs in your browser and keeps everything in memory. For the commands it knows, it shows output in the same form as real Git, but it does not know everything. Commands such as push, pull, clone and diff are not included.
Does it change files on my computer?
No. The folders and files in the practice terminal exist only on this page. When you close or reload the page they are gone. Only which lessons you finished is saved in this browser.
What can I learn after this course?
The next steps are working with a copy of a repository on another computer or a website (clone, push and pull) and merging branches that both changed. For that you need real Git installed on your own computer.
Is what I type sent anywhere?
No. The commands run in your browser and nothing is sent anywhere. You can check this yourself: switch off your internet connection after the page has loaded and the tool still works.