Menu
Coddy logo textTech

Git Add

Part of the Version Control section of Coddy's Terminal journey. Lesson 10 of 58.

The git add command moves changes into the staging area. You name the file (or files) you want to stage:

git add hello.txt

You can stage several files at once, or use a wildcard:

git add file1.txt file2.txt
git add *.md

Or stage every change in the current folder with a single dot:

git add .

After staging, git status --short shows the file with a different prefix. Untracked files used the ?? code; staged new files use A (for added).

A  hello.txt

The file is now ready to be included in the next commit.

challenge icon

Challenge

Beginner

The folder contains a file called welcome.txt. Initialize the repository, stage welcome.txt, then run git status --short.

The expected output is the staged-add line.

Try it yourself

Terminal
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Version Control

Practice on your own: Terminal playground