Git Tracking and Checking Changes Commands Guide

Tracking and Checking Changes

git status - Check Working Directory Status

Displays the state of the working directory and the staging area.

Option Description
-s, --short Output in short format
-b, --branch Show branch information as well
--ignored Show ignored files as well

Examples:

git status - Display the current state of the working directory
git status -s - Display status in short format
git status -sb - Display status in short format including branch information

git add - Add Changes to the Staging Area

Adds changes to the staging area (index).

Option Description
-A, --all Stage all changes
-p, --patch Interactively select changes to stage
-u, --update Stage only tracked files

Examples:

git add file.txt - Stage a specific file
git add . - Stage all changes in the current directory
git add -A - Stage all changes in the repository
git add -p - Interactively select changes to stage