0

Is there a way to tell git-status to ignore the contents of specific folders when invoked from outside of these folders?

I would like to see the changes I made in these folders only when I enter them and call git-status. If possible I would like to have the same behavior but only for un-tracked files.

Example:

$ git init foo
$ cd foo
$ mkdir bar
$ git add bar

foo$ touch bar/README
foo$ git status ----> Empty
foo$ cd bar
foo/bar$ git status -----> README is un-tracked
Xyand
  • 4,470
  • 4
  • 36
  • 63
  • Sounds like you might want to take a look at submodules: http://git-scm.com/book/en/Git-Tools-Submodules – Kjell Andreassen Jul 15 '12 at 19:32
  • I don't use submodules as I want to have a single repository. Actually I am using `git-subtree` but I wish to avoid adding tons of generated temporaries to .gitignore files. – Xyand Jul 15 '12 at 19:45
  • No, it is not possible. Git does not track empty directories at all. It is not likely to be reconsidered, too. But take a look at `git status -u` and accompanying configuration options. – fork0 Jul 15 '12 at 20:55
  • What do you mean by empty? I don't think I mentioned any empty folders. `git status -u` doesn't do exactly that. thanks. – Xyand Jul 15 '12 at 21:30
  • 1
    pipe the output through `grep`, filtering out things that start with `../`, and make an alias of this command -- call it `git substatus` – gahooa Jul 16 '12 at 00:15
  • Thanks. I'll make another one to filter specific folders I wish to ignore. – Xyand Jul 16 '12 at 04:43

0 Answers0