title: Nested git repository inherits ignore files from parent git repository. Can this be disabled?
body: <p>I'm working on a linux system with nested git repositories. My file/directory structure is as follows:</p>
  
  <pre><code>~/
      .git/
      .gitignore
      file1
      project/
          .git/
          file2
          file3
  </code></pre>
  
  <p>In my homedir I have created a repo for my linux config files. The ignore file (~/.gitignore) contains only '*' (exclude everything). I have added files with 'git add -f file'. In a nested repo (project) I have discovered that everything is excluded as well even though the correct '(~/project/).git' directory is updated on commit. I have checked this with the following command:</p>
  
  <pre><code>&gt; cd ~/project
  &gt; git add file2 
      The following paths are ignored by one of your .gitignore files:
      file2
      Use -f if you really want to add them.
      fatal: no files added
  
  &gt; git check-ignore -v file2
      ~/.gitignore:1:* file2
  </code></pre>
  
  <p>The command check-ignore is available as of version 1.8.2 and was motivated by the stackoverflow question: <a href="https://stackoverflow.com/questions/12144633/which-gitignore-rule-is-ignoring-my-file">which gitignore rule is ignoring my file</a>.</p>
  
  <p>My question is if there is a way to change the behaviour git regarding ignore files to only process the ignorefiles encountered until the repo is found that git commits to, e.g., stop processing ignorefiles higher up in the directory structure than the first '.git' folder is found (in this case ~/project/.git).</p>
  
  <p>Thank you!</p>