DELAPARRA
Index
Color
NL
Category: Git commands

git add

Explained by Updated

What is git add?

git add: Stage file changes — mark them as ready to be committed. git add moves changes into the staging area, the set of changes that will go into your next commit. git add file.php stages one file and git add . stages everything in the current folder. The staging area lets you choose what belongs together. You might have changed five files, but only three relate to the bug fix. Stage those, commit them, and commit the rest separately.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about git add

What should you keep in mind with git add?

git add -p is especially useful. It shows each change in a file and asks whether to stage it, so you can even split changes within one file. Before committing, check git status or git diff --staged to see exactly what is included. That catches debug code, local config files and unrelated changes before they end up in history.

At a glance

CategoryGit commands
Explained by
Updated

More Git commands terms

All terms starting with G

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.