I have several projects that have a large number of files that, when processed, generate other files. There is no need to track the generated files, in fact, in some cases you
You can't do that with the .gitignore
. You'll want to split generated files and user files into separate folders, and ignore the whole generated folder.
See if you can put the generated files in a special folder say tmp. Then you can just add this folder in .gitignore
tmp/
Several simple solutions:
.pdf
) to .gitignore
as *.pdf
, and git add -f
those version-this-one.pdf
that should be versioned, git
will keep track of those (need a bit of care). The *.pdf
is really a glob, so you could exclude, say, PDFs whose hames start with uppercase by [A-Z]*.pdf
.*.pdf
for all PDFs, and !version-this-one.pdf
to exclude one from the excluded set (can also use a pattern here).gitignore
. Need to keep it up to date (not too bad, if a new one shows up, git
will consider it untracked, just add it then)..gitignore
: git
searches first in this directory's .gitignore
, if not found in the parent's, ... As you can exclude patterns with !
, this stops a search there. Check out gitignore(5)
.