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*

2
  • 40
    Adding Hello.class to .gitignore will ignore any file called Hello.class in any subdirectory. If you intend to only ignore the file Hello.class in the same directory as the .gitignore file, use a /Hello.class line instead. Commented Nov 29, 2010 at 22:21
  • 6
    @Imray you can put .gitignore anywhere in a git project - if a path starts with /, it will be relative to the location of the .gitignore file; otherwise it will refer recursively to files in the current directory and its descendant directories. Commented Jan 5, 2015 at 10:29