问题
I'm finally trying to learn how to git, so I'm writing a rather extensive thesis with version control on GitHub. I have a free GitHub pro account, thanks to my University, so I can add private repositories.
I need to add my supervisor, so he has access to the documents, but I want his his GitHub account to have read-only rights.
How do I allow read-only access to a private repository on GitHub with a specific user?
回答1:
Considering that a collaborator on a simple GitHub repo has push access, you have a few options:
transferring your repo to an organization (that you have created): you can then restrict push: Then you can add an external collaborator with only read access:
(the image shows wirte access, but the point is: you can select "Read")or you can protect and restrict write access to branch (but you need to do that for all branches)
来源:https://stackoverflow.com/questions/37361422/share-a-private-git-repository-on-github-with-a-specific-user-as-read-only