SyntaxStudy
Sign Up

git add

command

Stages changes for the next commit. Can add specific files, directories, or all changes.

Syntax

git add <pathspec>

Example

bash
git add file.txt          # add specific file
git add src/             # add directory
git add .               # add all changes
git add *.php           # add by pattern
git add -p              # interactively stage hunks