If I don\'t want .html files tracked I can add the pattern to .gitignore and they\'ll be ignored. I\'d like to know how I can do the converse - at checkout, how could I ask git
If you only want to checkout a portion of your repository, you can use git's sparse-checkout option which has powerful include/exclude rules.
The following StackOverflow question has some helpful instructions:
GIT checkout except one folder
But as a summary:
Enable the sparseCheckout
option:
git config core.sparseCheckout true
Create the file called .git/info/sparse-checkout
containing:
/*
!node_modules
which effectively means include everything except the node_modules
directory when checking out a repository into the working directory.