text: Q:
  
  Ignore files with names starting with 'output'
  
  I have a program that generates text files output1.txt, output2.txt, output3.txt, etc.. I want Git to ignore these files. I can't block text files, as I have some text files that shouldn't be ignored. Also, the files are dynamically generated (there is no limit to the number appearing after “output”), so can't add the file names statically. Can someone please help me with this?
  PS. I've checked out this Make .gitignore ignore everything except a few files, but it refers to a set of files alread known. In my case it might be a long list.
  
  A:
  
  Pattern matching doesn’t just work before the extension. Just as much as you can ignore *.txt, you can ignore:
  output*.txt
  
  A:
  
  Just add the following to your gitignore:
  output*.txt
  
  * is a "wildcard", so it will match anything. 
  
  A:
  
  Using * just as in regex matching (or wildcard matching) will do the job. Just provide the entry 
  output*.txt into your .gitignore file, and the problem is solved!
  
  