About
The status of a file in a working directory is one of:
where:
Tracked / Untracked
Each file in a working directory can be in one of two states:
- or untracked.
Tracked
Tracked files are files that were in the last snapshot (ie head). They can have the status:
- unmodified,
- modified,
- or staged (ie in the index for the next commit)
Untracked
Untracked files are new files.
More specifically, they are any files in the working directory that:
- were not in the last snapshot
- and are not in the staging area (next commit).
Management
Modification
- From untracked to deleted: git clean -f Git - Clean
- From staged to unmodified : git reset HEAD file Git - Reset (Unstaging) - Delete a change for the next commit
- From modified to unmodified : git checkout -- file What is a Git Checkout?
- From modified to staged: git add <file>... Git - Add command (Staging) - Add a change to the next commit
Get
git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: syntax.php
no changes added to commit (use "git add" and/or "git commit -a")