I have a website project that has more than 50,000 unimportant files (to development) in some directories.
/website.com/files/1.txt
/website.com/files/2.txt
Creating a sub-repo is one solution, but you should make that sub-repo a submodule.
That way:
git submodule update " (that is without filling the 'files' contentgit submodule update after the git submodule init will be enough to get back the right version of the 'files' content.The code below works on deleted as well as modified files to ignore it when you do a git status.
git update-index --assume-unchanged dir-im-removing/
or a specific file
git update-index --assume-unchanged config/database.yml
Ignore modified (but not committed) files in git?
Beware: The suggestion above for deleted files when you do a "git commit -am " includes the deleted file!
A solution that would work for me is to instead of deleting the file, just make it's content blank. This is what I used to mute a .htaccess file.
Ignoring a whole directory didn't work. I had to do this:
for i in `git status | grep deleted | awk '{print $3}'`; do git update-index --assume-unchanged $i; done
Ok Ive found a solution. Simply create a new repo in the sub directories and the parent repo will ignore them.