๐ŸŽ‰ Special Offer !    Code: GET300OFF    Flat โ‚น300 OFF on every Java Course
Grab Deal ๐Ÿš€

Check Repository Status - git status


Introduction

  • git status command is used to check the current status of your Git repository. It helps us to understand the state of your working directory and staging area.
  • What does git status do ?
    • It shows which files are staged, unstaged or untracked.
    • It helps you to see if there are changes to commit, files to stage or untracked files.
  • When to use git status ?
    • To check which files are ready to be committed.
    • To see if there are untracked files that need to be added.
    • To verify if there are any unstaged changes before committing.
    • To ensure your working directory is clean before switching branches.

How to use git status ?

  1. Open the Git terminal (or command prompt) and navigate to the project folder where your Git repository is initialized.
  2. Run the git status command:
    git status
  3. The command will show the following:
    • Git Status Command
    • Here we have modified aaa.txt and added in stack (which will be explained in next tutorial) and created one more file i.e. bbb.txt.
    • Explanation of above image is as follows :
      • Current branch name: If you are on the main or any other branch.
      • Staged changes (Ready for commit): Usually shown in .
      • Unstaged changes: Modified but not yet added to the staging area, shown in .
      • Untracked files: New files not tracked by Git yet, shown in .
      • Merge conflicts or warnings: Usually shown in .