git add

The command that copies a file's current content into the staging area so it will be part of the next commit.

In more detail

git add reads the file as it is at that moment, stores the content as a blob and records its ID in the index. Editing the file afterwards changes only the working tree; run git add again to stage the newer content. It is also how you start tracking a new file.

Example

git add notes.txt

Related terms

Taught in

References