18

After looking at git ignore exception, I realized that one can ignore files in a repository from a global .gitignore file.

Is there any way that you can override all rules from the global .gitignore file, so that the repository will have everything in it and nothing ignored? (besides un-ignoring every file individually)

Community
  • 1
  • 1
Blue Ice
  • 7,888
  • 6
  • 32
  • 52
  • you mean in a subfolder? something like !subfolder/*.dll ? – lib Oct 31 '14 at 16:12
  • It seems to me you could "override all rules from the global .gitignore" simply by removing the `.gitignore`. Perhaps that's not quite what you want, though... – twalberg Oct 31 '14 at 18:10

2 Answers2

38

Create a .gitignore in the repo folder with one rule:

!*

This forgets the rules (with !) of all of the files (*) in the main .gitignore.

Julien Kronegg
  • 4,968
  • 1
  • 47
  • 60
Blue Ice
  • 7,888
  • 6
  • 32
  • 52
2

You can.

Create you own .gitignore file with appropriate rules and put into directory in where it shall apply. The rules will be applicable for a directory with local .gitignore and its subdirs.

John Topley
  • 113,588
  • 46
  • 195
  • 237
Valeri Atamaniouk
  • 5,125
  • 2
  • 16
  • 18