Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

git

What is the git status -u command in Git?

Amaaz Ahmad

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

The git status command is used to display the current status of the local repository. The information displayed by the git status command includes the name of the branch, the current status of the branch, staged/unstaged changes, etc.

Different options can be used with the git status command to change its default behavior. The complete list of these options can be found here.

The -u option

The -u option is used with the git status command to alter the displayed information related to untracked files and directories.

Syntax

git status -u[mode_name]

or:

git status --untracked-files=mode_name

In the above snippet of code, mode_name is replaced by one of the three available options, altering the displayed information related to the untracked files and folders.

The following table enlists and briefly explains the choices we have for the mode:

Option

Description

no

Does not display the untracked files and folders.

normal

Displays the untracked files from the current directory and untracked folders. Does not display the specific untracked files from untracked folders.

all

Displays all the untracked files and folders, including untracked files that are present in untracked folders.

Note that there is no space between the -u option and mode_name or --untracked-files= and mode_name.

Example

git status -uall

The command shown in the above snippet of code will display all untracked files from the current working directory and other directories as well.

RELATED TAGS

git

CONTRIBUTOR

Amaaz Ahmad
Copyright ©2022 Educative, Inc. All rights reserved

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring