34

I use Tower for using Git in Mac. The settings in Tower has Ignores section which creates the .gitignore, but it has another section named "Excludes". And it seems like that one can use excludes with "# git ls-files --others --exclude-from=.git/info/exclude".

Tower screenshot

What Excludes is for? Why one needs excludes when gitignore is available?

MartinW
  • 4,966
  • 2
  • 24
  • 60
prosseek
  • 182,215
  • 215
  • 566
  • 871

1 Answers1

44

It's a list of files that are not in .gitignore (which can be versioned), but which you want to exclude on your machine's copy of the repo.

From the docs:

Patterns which are specific to a particular repository but which do not need to be shared with other related repositories (e.g., auxiliary files that live inside the repository but are specific to one user's workflow) should go into the $GIT_DIR/info/exclude file.

Note that .git/info/exclude can not be versioned because it's in the .git directory.

Matthew Flaschen
  • 278,309
  • 50
  • 514
  • 539
  • 10
    So, it's basically a `.gitignore` that doesn't get revisioned? For if I want to ignore some files, but don't want others to ignore them? – Cole Tobin Apr 11 '15 at 22:35
  • 11
    @ColeJohnson, exactly. For example, if you're the only one on your team who uses a particular IDE, you can exclude files it creates. – Matthew Flaschen Apr 17 '15 at 00:30