Forrest logo
back to the git tool

git-ls-files:tldr:4f48d

git-ls-files: Show ignored and untracked files.
$ git ls-files --others
try on your machine

The git ls-files --others command is used to list the untracked files in the Git repository. It displays the paths of any files that are not currently tracked or managed by Git.

Here's a breakdown of the command:

  • git refers to the Git command-line tool.

  • ls-files is a Git subcommand that lists the files in the Git repository.

  • --others is a flag used with the ls-files subcommand. It specifies that only untracked files should be displayed.

When you run git ls-files --others, Git will scan the repository and display the paths of any files that exist in the working directory but are not included in the Git index. These files are considered untracked, meaning they have not been added to the repository and are not part of any commit history.

This command can be useful to check what files are not being tracked by Git, which can be helpful when deciding which files to add or ignore in a commit.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the git tool