git: listing directories to include

In its normal behaviour, git is for a whole directory, apart from exclusions via .gitignore, and any special git files.

What if we want to whitelist what to include?  There isn't a .gitfoo file for this.  But it can probably be achieved via a double negative for files, and a double negative twice for directories:

.gitignore:

*
!included_file
!included_dir/
!included_dir/*

This is especially useful for picking out parts of a home directory to replicate.

Comments

Popular posts from this blog

the persistent idiocy of "privileged ports" on Unix

hardly any suitcases or shopping trolleys have brakes

you are even more disgusting than before the pandemic, especially you disgusting bloated milky (non-Jap) ones