Confirmed users
1,643
edits
| Line 127: | Line 127: | ||
All these statements mean the same thing: "I git add a file" | All these statements mean the same thing: "I git add a file" | ||
The index(referred as "stage area" sometimes) put things that you proposed for the next commit and does not contain file content. While a git-commit command submit, Git checks the index rather than your working directory to discover what to commit. | |||
Here is a sample using git add and commit | Here is a sample of using git-add and git-commit command to modify index and tree object. Figure 3 and 4 reveal git directory changes accordingly. | ||
<span style="color:blue">$ mkdir git_sample_cache</span> | <span style="color:blue">$ mkdir git_sample_cache</span> | ||
<span style="color:blue">$ cd git_sample_cache</span> | <span style="color:blue">$ cd git_sample_cache</span> | ||