what is the best solution to solve this problem. We have a big repo. Due to security restriction people are not allowed to have copies of files on mobile workstations like laptops. But there are folders within the repo that are excluded from this rule. The goal is to be able to easily develop inside this subdirectory and pull and push and handle branches of the main repo.
So the question is here is there anyway to clone/checkout just a subdirectory from a git repo without having a full copy of the repo locally. Doing my research I came across some solutions. Maybe someone can help clarify which would be the easiest way to solve this problem.
Thanks in advance for any help.
That is not the concept of Git. Git is a decentralized version control system. The local copy is the main concept. Normally you should avoid large repositories and you should exclude media and upload folders for example. Git isn't made for large files. For that is the Git LFS project.
You can set only rights on the complete repository if you give someone rights then he can clone the whole repository and you don't have some security in that case and it doesn't matter if you clone a folder or the complete repository.
The correct way could be to remove all important and large files / folders from the repository. And make a repository without real data. You have to make a new repository because all old committed files stay in the repo. There you can cleanup your files and add only scripts and files that you need to develop.
You can work with submodules but that is really a lot of work.