gitpractice.dev

brewly — Ch.1 · Look around

Exercise 3 of 11

Before you start

State and history

A commit is a saved snapshot of the project, with an author, a date and a message. All commits together are the history.

HEAD marks where you are. origin/main marks where the main branch was on the server.

Looking is always safe: these commands never change anything.

git status
where am I, and has anything changed?
git log
the full history, newest commit first
git log --oneline
one short line per commit
git log -n 1
only the newest commit (any number works)
You can reopen this any time with “Lesson”.

Continue on a desktop

Typing git on a small screen is no fun. Open this page on a laptop or desktop to practise.

Back to the path