How To Check Status Of Your Files?
Table Of Contents:
- What Is The Status Of A File?
- How To Check The Status Of Files?
- Examples Of Checking Status.
(1) What Is The Status Of A File?
- By knowing the status of a file we can see, which changes have been staged, which haven’t, and which files aren’t being tracked by Git.
- It will just show you, in which state the files are.
![](https://www.praudyog.com/wp-content/uploads/2023/03/71.png)
(2) How To Check Status Of Files?
- To check the status of the file run the below command.
git status
(3) Examples Of Checking Status
![](https://www.praudyog.com/wp-content/uploads/2023/03/65-1024x398.png)
Example-1: Initial State
git status
![](https://www.praudyog.com/wp-content/uploads/2023/03/66-2.png)
Note:
- At first, the files are untracked, which means ‘git’ is not tracking the files.
- Any changes made to the files will not be tracked by ‘git’.
- Untracked files will be in red colour.
Example-2: After Adding To Staging Area
git add .
git status
![](https://www.praudyog.com/wp-content/uploads/2023/03/68-1.png)
Note:
- When you add the files to the staging area, any changes made to the file will be tracked by ‘git’.
- Stagged files will be in green colour.
Example-3: After You Make Changes To File
git status
![](https://www.praudyog.com/wp-content/uploads/2023/03/73.png)
Note:
- You can see that it is showing File1.txt is being modified.