If there really are files that should not be publicly run for the sake of securities, do not put them in the repository or encrypt the files with a password!
Best of all, when you put unshared files in a separate repository, which can live in a private version of development:
BASE_DIR/.git
BASE_DIR/private/.git
Here BASE_DIR contains all publicly available files. BASE_DIR / private contains private files.
When you just publish data, not a repository (with all its history), you can simply
git --work-tree=PATH_TO_THE_PUBLIC checkout HEAD -- .
when the new version appears.
source
share