Displaying status of files in Git

Git status command provides information about the local working directory.It provides information such as:

  • Current branch
  • Files in the staging area
  • Untracked/tracked files


git status command

As the message above states that there is an untracked file test.txt we can add the file using the git add command:

$ git add test.txt

As we can see above using just the git status command displays a detailed output.If we do not want to display all the messages and hints.To prevent all the hints from getting displayed we can use the -s switch as:

$ git status -s

git status short

Now instead of displaying detailed output we get only the relevant information.Here it displays a single untracked file test.txt.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *