git status command
The git status command in Git provides a snapshot of the current state of the working directory and the staging area. It offers valuable information about changes in the repository, indicating which files have been modified, which changes have been staged for the next commit, and which files are untracked. By using git status, users can assess the status of their project, make informed decisions about which changes to commit, and identify files that are yet to be tracked or committed.
Bash
git status -s The git status command with option -s or –short, outputs the status in a short format. This is a more compact view, which is useful for a quick overview.
Bash
The output of the above have some symbols in the front of the file, as shown in the following sample output: ?? newfile.txt M file1.txt A file2.txt M file3.txt The meaning of ??, M and A is explained below: • ?? indicates an untracked file. • M indicates a modified file. • A indicates a new file added to the staging area.