-1

I have created a GitHub repo and I want to invite someone else to work on only a branch of that repo so that they cannot make changes to the master or any other branch or merge branches. Simply put I don't want to invite them as a collaborator but to work on only one branch.

I tried to invite them as collaborator and create branch rules but ended up making an error when I tried to push in the master branch as well.

  • 2
    Does this answer your question? [How to restrict access to the master branch in Git](https://stackoverflow.com/questions/38864405/how-to-restrict-access-to-the-master-branch-in-git) – 1615903 Mar 31 '22 at 10:29

1 Answers1

0

I dont think you can do that. It s not the git way to constraint people to create branches. But you can protect branches that need to be protected from savage pushes. That way, users would have to make a PR and they will have to wait you approve it to merge it.

Clem
  • 2,150
  • 15
  • 17