I have a problem about applying source control. I tried lots of things but I cannot figure it out. While using source control, I want to be able to have different permissions for groups of users for different parts of the source code.
We used to have one big repository containing the entire (Visual Studio) solution and all projects. But this time we need to be able to manage the permissions for different parts of the source code (per projects). This is important for protecting some parts of the intellectual property.
To provide a little illustration of the context:
Azure-DevOps
in combination with git
repositories.What did I try:
Lots of things, but the closest to a working solution was:
CombinedRepo
.git-submodules
to CombinedRepo
.This set-up works when pulling the CombinedRepo
incl. the submodules using VS. I can test, debug and make changed etc.
However, I have the following issues with this set-up:
CombinedRepo
and changed code of one of the submodules, and want to commit these changes, we get this error: fatal: unexpected sequence in commit output.
(This is when using VS to commit).CombinedRepo
(when using VS).Visual Studio sees changes made in submodule folders, but fails to commit them.
To workaround it, go to Team Explorer - Manage Connections - Local Git Repositories - Add, browse to submodule folder and confirm with Add. Double click on the local repository created to open it.
Now You can commit changes and push them to the remote origin like You would do just in original submodule repository.
Than open again Your local repository containing the submodule folder, go to changes and commit them to include changed submodule state in main module.
Here are some feature request links, you could follow them to get the latest news.
In addition, If you only want to restrict users or team members from submitting code, we could set branch policy and disable the branch permission Bypass policies when pushing. Then all users need to create pull request to push the commit, and you could check the commit and approve the Pull Request.
Update
I want to be able to have different permissions for groups of users for different parts of the source code.
Thanks for Stefan sharing.
If we are using TFVC repo, we could configure the folder/file permission for groups of users. Check the pic below.