5. Making changes


  • To learn to monitor the working directory’s state

01 Changing the “Hello, World” page

Let’s add some HTML-tags to our greeting. Change the file contents to:

File: hello.html

<h1>Hello, World!</h1>

02 Checking the status

Check the working directory’s status.


git status

You will see …


$ git status
# On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#   modified:   hello.html
no changes added to commit (use "git add" and/or "git commit -a")

The first important ascpect here is that git knows hello.html file has been changed, but these changes are not yet committed to the repository.

Another aspect is that the status message hints about what to do next. If you want to add these changes to the repository, use git add. To undo the changes use git checkout.

03 Next ...

Staging the changes.