automatix
automatix

Reputation: 14532

How to list all not versioned files and directories in a Git working copy?

I'm developing on a VM and would like to see, which files and directories I need to add manually to my web directory on the remote server when I will be deploying the project (e.g. files with environment specific settings / credentials). How can I get a list of these files / directories?

Upvotes: 5

Views: 3227

Answers (3)

Mark Stewart
Mark Stewart

Reputation: 158

git ls-files -o

The -o option of ls-files will show untracked files.

If you would like untracked directories listed as directories and not all the individual files you can do:

git ls-files -o --directory

Upvotes: 14

atenart
atenart

Reputation: 319

git status -uall

This command will show all untracked files and directories including untracked files in untracked directories. Use -unormal to hide untracked files in untracked directories.

Upvotes: 1

Sailesh
Sailesh

Reputation: 26207

git ls-files --others --exclude-standard
  • --others option shows untracked files.

  • --exclude-standard option excludes the files that are included in gitignore or .git/info/exclude.

See git-ls-files.

Upvotes: 7

Related Questions