status # On branch master # Initial commit # Untracked files: # (use "git add <file>..." to include in what will be committed) # hello.txt nothing added to commit but untracked files present (use "git add" to track) (master)$ git add hello.txt (master)$ git status # On branch master # Initial commit # Changes to be committed: # (use "git rm --cached <file>..." to unstage) # new file: hello.txt
and the index. git diff –cached: Show differences between the index and the most recent commit. git diff HEAD: Show the differences between your working directory and the most recent commit.
Switched to a new branch 'dev_feature' switch to an existing branch: (dev_feature)$ git checkout master Switched to branch 'master' (dev_feature)$ echo "new feature" > feature.txt (dev_feature)$ git add feature.txt (dev_feature)$ git commit -m "feature"