gitpractice.dev

brewly — Ch.1 · See what changed

Exercise 4 of 11

Before you start

The three areas

The working tree is the folder you edit.

The staging area (also called the index) holds what the next commit will contain.

The repository holds the commits.

Seeing your changes

Here you do not type code. The "Write the code" button edits the files for you.

In a diff, lines starting with + were added and lines starting with - were removed. A line starting with @@ says where in the file you are.

git status
which files changed?
git diff
which lines changed, and are not staged yet?
git diff --staged
which changes are already staged?
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