Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • Maybe you have core.excludesfile = ~/.gitignore. Without such a configuration, the file is not applied to any repository except one stored in ~/.git (even then it would not apply to sub-repositories). I use core.excludesfile = ~/.git-user-excludes to avoid the conflict between the excludes I want applied to all my Git repositories (regardless of location) and the excludes I want applied to the repository that holds (parts of) my home directory. Commented Sep 11, 2010 at 20:23
  • @Chris: I know extremely little about git. I may have misunderstood this sentence in the gitignore man page: “Patterns read from a .gitignore file in the same directory as the path, or in any parent directory (…)” Does it in fact stop at the root of the checkout (i.e. where the .git directory is)? Commented Sep 11, 2010 at 20:57
  • 1
    Yes, the upwards search for .gitignore files is bounded by the root of the working tree. The sentence you quoted continues: “(up to the toplevel of the work tree)”. Commented Sep 11, 2010 at 22:15
  • @Chris: my version of the man page doesn't have these words — it looks like the wording has been clarified. I've corrected my answer. Thanks! Commented Sep 12, 2010 at 0:28
  • this was discussed in chat recently Commented Dec 1, 2013 at 22:22