The way Git works is that if anyone has access to the repository, they have access to the entire repository. There is no way to functionally prevent people from accessing the data. This is documented in the gitnamespace(7)
manual page.
In general, it's fine to rely on people honouring the copyright of the files as distributed. Even in open source projects, the expectation is that people will follow the copyright and license of the author. Using a technical measure, such as DRM, can ultimately be bypassed and gives you no better legal protection, and it will anger many people.
However, for the convenience of your users, if your project itself is open source and you wish to include non-open-source assets, then you should include those in a separate repository with their own license file. That simplifies distribution for projects who may wish to use your code but are unwilling to distribute proprietary assets. It also makes it clearer that those assets are not distributed under the same license.