How to do 'git status' on untracked directory?

I have 6,000 untracked files in one subdirectory and I’m constructing .gitignore files to filter out the unwanted ones. I’m testing my gitignore filters as I go by running ‘git status‘.

However, I have a larger number of untracked other files in a different subdirectory, so ‘git status’ shows all of those too, which makes it very hard to see what the .gitignore rules are doing.

  • How to find files changed by commits message
  • Relationship between git commits and review items in Gerrit
  • Planning repository layout for git migration
  • Git: prevent staging some files, automatically stage all
  • Go: how to add git revision to binaries built?
  • Groovy bootstrap error using GIT BASH on Windows 7
  • If the files were tracked, then I could just do ‘git status .’ and it would restrict the git-status output to only those files in the current directory, but because the current directory and all its contents are untracked, ‘git status .’ returns “error: pathspec . did not match any file(s) known to git.”

    I’m using git-1.6.6.1 for this, although interestingly my testing shows that git-1.7.1 (on a different system) does actually let you do git-status on an untracked directory. Unfortunately I can’t upgrade git on this system. Is there a known workaround for -1.6.6.1?

  • Using SVN commands alongside git-svn: Possible? Advisable?
  • Unable to determine upstream SVN information from HEAD history
  • Git: Merging but overwriting changes
  • Git: Default all text files to unix line breaks
  • Gerrit replicating to gitolite fails
  • Git File Integrity
  • 2 Solutions collect form web for “How to do 'git status' on untracked directory?”

    I would temporarily add the unwanted (different) sub-directory to the .gitignore file, so that all its contents are ignored. Then, when you’re ready, remove the entry for the previously unwanted sub-directory from .gitignore so that its files become tracked by git status once more.

    You can try:

    git add --dry-run -A
    
    Git Baby is a git and github fan, let's start git clone.