Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Git Guides
Git Status illustration

Git Status

git status

git status shows the current state of your Git working directory and staging area.

What Doesgit status Do?

When in doubt, rungit status. This isalways a good idea. Thegit status command only outputs information, it won't modify commits or changes in your local repository.

A useful feature ofgit status is that it will provide helpful information depending on your current situation. In general, you can count on it to tell you:

  • WhereHEAD is pointing, whether that is a branch or a commit (this is where you are "checked out" to)
  • If you have any changed files in your current directory that have not yet been committed
  • If changed files are staged or not
  • If your current local branch is linked to a remote branch, thengit status will tell you if your local branch is behind or ahead by any commits

During merge conflicts,git status will also tell you exactly which files are the source of the conflict.

How to Usegit status

Common usages and options forgit status

  • git status: Most often used in its default form, this shows a good base of information
  • git status -s: Give output in short format
  • git status -v: Shows more "verbose" detail including the textual changes of any uncommitted files

You can see all of the options withgit status ingit-scm's documentation.

Related Terms

  • git clone [url]: Clone (download) a repository that already exists on GitHub, including all of the files, branches, and commits.
  • git remote -v: Show the associated remote repositories and their stored name, likeorigin.
  • git remote add origin <url>: Add a remote so you can collaborate with others on a newly initialized repository.
  • git push: Uploads all local branch commits to the remote.
  • git push -u origin main: When pushing a branch for the first time, this type of push will configure the relationship between the remote and your local repository so that you can usegit pull andgit push with no additional options in the future.

Contribute to this article on GitHub.

Get started with git and GitHub

Review code, manage projects, and build software alongside 40 million developers.

Sign up for GitHub Sign in

[8]ページ先頭

©2009-2025 Movatter.jp