Denying external files in git

We have a common problem. We are using the repo tool to host multiple git repos in a build tree. Unfortunately, users keep adding (possibly with -f) and compiling files that are in other repositories. Example:

#ls
root/gitRepoA
root/gitRepoB
#cd root/gitRepoA
#git add -f ../gitRepoB/myFile
#git commit

      

Is there a way to avoid this?

EDIT: This is only possible when using the repo tool.

+3


source to share


1 answer


This should not be possible if both directories are git repos (i.e. have .git

)

I just tried:



C:\prog\git\tests\multipleRepos\r2a>git add -f ..\r1\f1r1
fatal: '..\r1\f1r1' is outside repository

      

+2


source







All Articles