snippetjavascriptTip
View the current Git status
Viewed 0 times
statusgitviewthecurrent
Problem
Git provides a command to view the current status of the working tree. The
If you want a more concise output, you can use the
git status command shows you which files are staged, unstaged, and untracked, as well as the current branch you're on.If you want a more concise output, you can use the
-sb flag to view the short form of the status. This is useful when you want to quickly check the status of the working tree without the additional details.Solution
# Usage: git status [-sb]
git status
# On branch patch-1
# Your branch is up to date with 'origin/patch-1'.
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
# 30-seconds.txt
#
# nothing added to commit but untracked files present (use "git add" to track)
git status -sb
# ## patch-1...origin/patch-1
# ?? 30-seconds.txtCode Snippets
# Usage: git status [-sb]
git status
# On branch patch-1
# Your branch is up to date with 'origin/patch-1'.
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
# 30-seconds.txt
#
# nothing added to commit but untracked files present (use "git add" to track)
git status -sb
# ## patch-1...origin/patch-1
# ?? 30-seconds.txtContext
From 30-seconds-of-code: view-status
Revisions (0)
No revisions yet.