git status
git status
: show the status of the working tree.
The git status
command is used to display the current state of your Git repository. It shows which files have been modified, which files are staged for commit, and which files are not being tracked by Git. This command is incredibly useful for understanding what changes you have made since your last commit and what will be included in your next commit if you proceed.
When you run git status
, Git will output information about the current branch, any changes in your working directory, and the status of your staging area. It will also provide helpful suggestions on what to do next, such as using git add
to stage changes or git commit
to commit staged changes.
git status
is a safety net that allows you to double-check your changes before committing them to the repository. By reviewing the output of git status
, you can ensure that you're only committing the changes you intended to and avoid accidentally including unwanted modifications.
Examples
Check the status of your working directory:
git status
Typical output of git status
might look like this:
On branch main
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: index.html
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: index.html
Untracked files:
(use "git add <file>..." to include in what will be committed)
styles.css
Hi! I'm Alex, creator of GitByBit.
And this is Gitopedia—a reference that summarizes knowledge in my Git course.
Gitopedia is designed to be a personal knowledge base. When you progress through the main Git course in VS Code, you unlock all of these topics, one by one, bit by bit. This gives you time to digest the information and gradually build the mental model of Git. Here's an example of how it works:
Learning directly in VS Code lets you practice Git exactly as you would in real life, doing real jobs, writing real code. In addition, the course has access to your actual terminal, so it can point out mistakes, suggest workarounds, etc.
The course is FREE, there are no Ads or other bullshit. There are optional premium add-ons you can purchase, mainly to support my work (regrettably, I have to eat every day), but that's totally up to you.