- Git status is a command to see the file tracking information of git working directory
- To verify the files are added to staging area, we need to run git status , then we can see the response
- As the Staged files (git added files) with green colour, as shows changes to be committed
- And non staged files (non git add files) are shown with red colours, as shows untracked files.
To see status | git status |
To see status in short | git status -s |
Types of Tracked files :
(i) Modified Files :
- After tracking enabled by the git add command, if you made some changes on any file, the git tracking system will identify it, mark it as a Modified file.
- For an example : Edited the one.txt , added some information and saved
- We can the git status response as modified , changed not staged
- So we again need to add the files to staging area by running git add <Modified file name>
(ii) Un Modified :
- if you did not change any code on any file , that file is marked as an unmodified file by git.
- Shows the git status response as Changes to be committed
(iii) Remove files from Staging area (un staging) / un Tracking :
- If you want to remove a file from staging/tracking with any reason
- We can simply remove it by using this command
git rm –cached <filename> |
- By removing a staged files, it will be moved to untracked files list
Git short status indication :
A: Staged/Tracking File
M: Modified
??: Untracked/Not staged file