I have a site that has a /sites/default/files/
directory where user content is typically kept. Figuring that I don't need to be tracking this stuff, I added /sites/default/files/ to my .gitignore file.
Then I discovered that I also wanted to keep some mostly-permanent uploads in that directory as well. Now it makes more sense to track everything in /sites/default/files/ and exclude undesirable subdirectories, instead of doing it the other way around.
The problem is that Git won't stop ignoring that directory. I have removed the lines from .gitignore that specify this directory and it won't track it. I have the option to use git add /sites/default/files/ -f
to force git to track the directory, but I've done that before and it seems messy.
If .gitignore no longer specifies that directory as ignored, why would I have to force Git to start tracking those files?
git add -f sites/default/files/*
to add the specific files, rather than adding the directory.git add -f sites/default/files/*
didn't do it: when Itouch sites/default/files/test.mine
git still doesn't see it..gitignore
that match then - some wildcard of some sort or something? Or something that would cause the individual files to be ignored - like a*.pyc
, and that directory only containing.pyc
files? Remember that namingfile
in.gitignore
also matches anysubdirectory/file
orsub/subdir/file
...files/
hidden among some other stuff and I was looking forsites/default/..
. Well that was a lot of effort over a stupid mistake. sigh. thanks.