Types of git add (original) (raw)

Last Updated : 24 Mar, 2026

Different variations of git add control how changes are staged before a commit, depending on the scope and type of changes.

Git add Variations

Different variations of the git add command control which changes are staged before committing.

**1. git add -A or git add --all: Stages all changes in the repository, including modified, deleted, and untracked files across the entire working tree.

A

**2. git add -u or git add --update: It add all the modified and deleted files but not any untracked files and it does this for the entire tree.

u1

Specifying a directory stages only modified and deleted tracked files within that path, excluding untracked files and without affecting parent directories.

u2

**3. git add . : This specific command will stage all the changes no matter what type it is whether it be untracked files or deleted files or modified files.

dot1

**4. git add * : Stages files using a shell wildcard pattern rather than Git’s internal tracking mechanism.

ls *

Screenshot-2025-11-21-145134

git add*

Difference between add -A, add -u, add ., and add *

Comparison of git add options based on what changes they stage and their scope.

git add -A git add -u git add . git add *
Stages all changes across the entire repository Stages only tracked (modified & deleted) files Stages all changes in current directory & subdirectories Stages files using shell wildcard
Includes untracked, modified, and deleted files Excludes untracked files Includes untracked, modified, and deleted files (current dir only) May miss untracked/hidden files
Works regardless of current directory location Can be limited to a specific path Does not affect parent directories Not Git-specific behavior
Reliable and recommended Reliable for tracked changes Reliable within current scope Not recommended due to inconsistency