WEEK 7 · LESSON 3 · TOPIC 5 OF 8 · Practical Application

Practical Application

Lesson progress

0% Complete

SECTION 1 OF 1

In this topic · 1 sections
  1. Overview

Overview

Use the following review loop:

  1. Run git status to inspect all pending changes.
  2. Choose a staging scope.
  3. Run the appropriate git add command.
  4. Run git status again to verify what moved into the staging area.
  5. If the selection is wrong, run git reset and stage again more precisely.

Example: stage the whole repository from its root.

git status
git add .
git status

Example: stage only one file.

git add 1.txt
git status

Example: stage a file inside a folder.

git add my-folder/3.txt
git status

Example: stage everything, reconsider, and return the changes to the working directory.

git add --all
git status
git reset
git status