Git 101 - Workflow

This is the most important part in understanding Git - every file can be in one of these states - untracked, modified, staged, or committed.

Initially, all files are untracked and are not part of the repository. You can add one or many untracked files to the stage, and then commit those. Those files will now be tracked and part of the repository.

The stage is just a temporary collection you can add and remove from, that keeps track of mutliple files you might want to commit in one go.

The 'stage' are often also referred to as the 'index', or the 'staging area'

You can make changes to the tracked files and they become modified. You can similarly add the modified files to the stage and commit just like before.

If you'd like an analogy, try out this one.

comments powered by Disqus