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

difference between timezone and offset

TAP Portugal web site now hanging same on firefox as chromium