How to show the current state of a repository?

git status

To show the current state of your working directory and staging area use git status. If your current local branch is linked to a remote branch, then git status will tell you if your local branch is behind or ahead by any commits.

Layer 1
Terminal Example
git status
On branch main
Your branch is ahead of 'origin/main' by 2 commits.
  (use "git push" to publish your local commits)

Changes to be committed:
  (use "git restore --staged ..." to unstage)

Changes not staged for commit:
  (use "git add ..." to update what will be committed)
  (use "git restore ..." to discard changes in working directory)

See git status to learn more about it.

Last modified on November 30, 2021.

You might also like