Today's tip: From Hello, World to hired.

Courses / Beginner

Git & GitHub in Practice

Commits, branches, merges and pull requests, and how to undo almost anything without panicking.

8 lessons4 hours355k learnersCertificate with Pro

Start the free first lesson

Code you'll write

Your first commitbash
git init my-project
cd my-project
echo "# My project" > README.md
git add README.md
git commit -m "Start the project"
Branchesbash
git switch -c feature/login
# ... edit files ...
git commit -am "Add login form"
git switch main
git merge feature/login
Undoing thingsbash
git restore notes.txt          # throw away unstaged changes
git restore --staged notes.txt # unstage, keep the changes
git revert HEAD               # undo the last commit with a new one