git status Command |
--
Git Tutorial
Git TutorialGit Installation and ConfigurationGit WorkflowGit Working Directory, Staging Area, and RepositoryGit Create RepositoryGit Basic OperationsGit Branch ManagementGit View Commit HistoryGit TagGit FlowGit Advanced OperationsGit Github")Git Server SetupSourcetreeGit QuizGitHub Actions
git status Command
git status is a command used to view the current state of a Git repository.
The git status command can check if files have been modified again after your last commit.
$ git status On branch master Initial commit Changes to be committed: (use "git rm --cached ..." to unstage)new file: README new file: hello.php
The git status command displays the following information:
- The name of the current branch.
- The relationship between the current branch and the remote branch (e.g., whether it is up to date).
- Unstaged changes: Shows a list of files that have been modified but have not yet been added to the staging area using
git add. - Untracked files: Shows a list of new files that are not yet under version control.
Based on the output of git status, you can determine the file status in the current working directory and take appropriate actions.
Usually we use the -s parameter to get a short output:
$ git status -s AM README A hello.php
The AM status means that the file has been modified after we added it to the staging area.
YouTip