Git practice
Read what to do, then type the Git command. One short lesson at a time, with reviews spaced out as you remember them.
77 commands in 11 lessons. Your progress is kept in this browser.
Getting started
- Just learned
- Recalling
- Steady
- Quick
- Fluent
- Second nature
- Learned
- 0
- Due now
- 0
- New
- 0
- Streak
- 0
Lessons
- 1Setting up
git config --global user.name "Ada Lovelace"git config --global user.email ada@example.comgit initgit clone https://github.com/acme/shop.gitgit config --global init.defaultBranch maingit config --list - 2Staging and committing, part 1
git statusgit status -sgit add cart.jsgit add -Agit add -pgit commit -m "Fix total" - 3Staging and committing, part 2
git commit -am "Tidy"git commit --amend --no-editgit diffgit diff --stagedgit rm --cached .envgit mv old.js new.js - 4Branches
git branchgit branch -agit branch featuregit switch maingit switch -c featuregit switch -git branch -m maingit branch -d featuregit branch -D spikegit branch --merged - 5Merging and rebasing
git merge featuregit merge --no-ff featuregit merge --abortgit rebase maingit rebase -i HEAD~3git rebase --continuegit rebase --abortgit cherry-pick a1b2c3d - 6Remotes
git remote -vgit remote add origin https://github.com/acme/shop.gitgit fetchgit pullgit pull --rebasegit pushgit push -u origin featuregit push --force-with-leasegit push origin --delete featuregit fetch --prune - 7History, part 1
git loggit log --onelinegit log --oneline --graph --allgit log cart.jsgit log -pgit log --author=Ada - 8History, part 2
git log --grep=logingit show a1b2c3dgit blame cart.jsgit refloggit diff main feature - 9Undoing changes
git restore cart.jsgit restore --staged cart.jsgit restore --source a1b2c3d cart.jsgit revert a1b2c3dgit reset --soft HEAD~1git reset HEAD~1git reset --hard HEAD~1git reset --hard origin/maingit clean -fd - 10Stashing
git stashgit stash push -m "half-done login"git stash -ugit stash listgit stash popgit stash applygit stash drop - 11Tags
git taggit tag -a v1.0 -m "First release"git push --tagsgit tag -d v1.0
How practice works
Each question describes a job, such as "create a branch called feature and switch to it", and you type the Git command that does it. Spacing and quote style do not matter, and common alternatives (git switch or git checkout) are both accepted.
- Learn shows each new command with its answer to type once, then asks for it again without help, and schedules the next review.
- Practice goes through a lesson at your own pace. Press Esc to see the answer. It does not change your reviews.
- Speed run asks every item once, without answers, against the clock. Get 70% right first time to pass.
- Today's session brings back what is due for review plus a few new ones.
A wrong answer tells you what was off, such as the text a pattern missed. After two tries the answer is shown, and you type it to move on. Progress is stored in this browser only; the daily goal and streak are shared with the keyboard shortcut practice.
To look something up instead, use the git commands list.