or staging, or cache
The Index is your proposed next commit
https://git-scm.com/
Isn't git commit -a enough?
Prepare commits
Make sure they contain only what is needed
Separate commits per subtask/change
Prevents committing undesirable changes (debug, local configuration...)
your new best friend:
git add
git diff
git diff --cached
git diff --staged
Git does not work with files, but with changes... And so do developers!
How to stage changes instead of files?
The reason why git add is your new best friend
Depending on the nature of a change, its impact and the way it is reviewed is different
Depending on the code, its impact and the way it is reviewed is different
Having different types of changes in a changeset makes it difficult to understand them properly
Is every committed changes what the developer wanted to commit (extra lines, debug, unused code...)?
Pros:
Whatever we well understand we express clearly, and words flow with ease.
Nicolas Boileau-Despréaux