Skip to TL;DR if you don't want to understand the context.
Context: I am handling internal team learning process, in which 1 of the assignment for the "student" (software engineer learning new tech/discipline) is to submit the project source code.
Since the learning material contains internal-only tech code, posting the assignment to github is out-of-scope. We have our own internal gitlab, so he said that what about simply submit as branch, but make that branch only accessible to evaluator and the submitter (so, student can't cheat other student project).
We don't want to create repo per student, as it will clutter our organization gitlab. Also: I don't want the students to submit as zip, as it's also clutter in local evaluator computer.
TL;DR: we want to make something like google codelabs, where student can clone barebone repo via private internal company gitlab, but they should submit their own assignment via their own "new branch" in the same repo, not "new repo". We want to make it private branch or anything that achieve that kind of goal.
In general, even if you could create private branches, they are typically not secure. Git provides a feature called namespaces that segments the references. In the manual page for that feature, it says:
All of this same text applies to all sorts of branch-specific access control mechanisms, whether using namespaces or not.
If you want to prevent other uses from getting access, you'd need to use separate repositories. In some environments, that might be a fork, although be aware that on some hosting platforms (e.g., GitHub) data in one fork is visible to all forks, which wouldn't work here. I know GitHub itself has a solution to this problem for educational platforms; perhaps GitLab has something similar.