Adding files
Adding (staging) files to a Git repository is pretty straightforward. We just add the changes to the repository and then commit them. We'll split this into two separate actions since they often happen at different times. This functionality is the equivalent of the git add
command.
Staging changes
We will not cover Git's staging area in detail, but it is useful for developers to know it is one of the three trees of Git (along with the working directory and commit history). It's roughly equivalent to TFS shelvesets, but can be a bit puzzling for developers who come from other version control products that do not have such a concept. In short, it can help to think of the staging area as a buffer between the working directory and the project history.
One development technique is to make lots of changes to unrelated files but to be sure to break up those changes into stages prior to a permanent commit. By splitting related changes into smaller logical...