Share a private git repository on GitHub with a specific user as read-only

冷暖自知 提交于 2021-02-04 19:22:10

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!