6. Staging the changes
Goals
- To learn to stage changes for the upcoming commits
01 Adding changes
Now command git to stage changes. Check the status
Run:
git add hello.html git status
You will see …
Result:
$ git add hello.html $ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: hello.html #
Changes to the hello.html have been staged. This means that git knows about the change, but it is not permanent in the repository. The next commit will include the changes staged.
Should you decide not to commit the change, the status command will remind you that you can use the git reset
command to unstage these changes.