Cjku/git: Difference between revisions

54 bytes added ,  29 October 2014
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"


Git’s index doesn’t contain any file content; it simply tracks what you want to commit. When you run git commit, Git checks the index rather than your working directory to discover what to commit.
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 commands to modify index and tree object. Figure 3 and 4 reveal git directory changes accordingly.
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>
Confirmed users
1,643

edits