Github restricting access

14,081

Solution 1

If all of the css/ux files are within a particular subfolder, and you want him to have access to everything in that directory, and further down, you could do it with git submodules.

The contractor would have push/pull rights to the repo that is a submodule, but no commit rights on the main repo.

You could also just use the pull request feature and make sure that he only commits to the folder he wants.

Solution 2

I haven't done this, but seems like maybe you have 2 options:

1) Grant the contractor pull access (but not push) to the repository. They can then fork it, do their work on their fork (probably within a branch?) and then send you pull requests and you would need to pull his/her changes in. Downside is that the contractor can't get code released to the server without your intervention (that could be an upside, depending).

2) If their work is isolated to one subtree, use two repositories and make one a submodule of the other. You can then set the access control differently in the 2 repositories, but you get a unified view of the project.

Share:
14,081

Related videos on Youtube

jignesh
Author by

jignesh

Updated on June 04, 2022

Comments

  • jignesh
    jignesh almost 2 years

    I am using github.

    I'm trying to figure out how to restrict repo access for a contractor i have.

    I have the main rails codebase and i also have a contractor that will be doing some css/ux type work for me.

    I want to give the contractor the ability to check in code to git hub only to certain folders.

    Ideally, i can have him checkin code and then it can be deployed out to the server so that he can see the changes.

    I don't think i can do this via limiting access within a specific git repo, but maybe there is a way to use two repo's and restrict access that way.

    Any help would be appreciated!

  • jignesh
    jignesh about 12 years
    I think the submodule may work better. I haven't worked much with the new contractor so I'm a little weary about giving him access and letting him commit to the right branch. Once i understand his working style a little more, that may be the simpler option.
  • Andy
    Andy about 12 years
    If you are on github, you can let him commit whatever he wants to his repo. When he is ready to commit hiw work, he can submit a pull request and you will be able to review his code before you pull it into the main repo