Github 限制访问

发布于 2025-01-08 12:33:06 字数 279 浏览 0 评论 0原文

我正在使用github。

我正在尝试找出如何限制我拥有的承包商的回购访问权限。

我有主要的 Rails 代码库,还有一个承包商将为我做一些 css/ux 类型的工作。

我想让承包商能够仅将代码签入 git hub 的某些文件夹。

理想情况下,我可以让他签入代码,然后将其部署到服务器,以便他可以看到更改。

我不认为我可以通过限制特定 git 存储库中的访问来做到这一点,但也许有一种方法可以使用两个存储库并以这种方式限制访问。

任何帮助将不胜感激!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

红衣飘飘貌似仙 2025-01-15 12:33:06

如果所有 css/ux 文件都位于特定的子文件夹中,并且您希望他能够访问该目录中的所有内容,并且更进一步,您可以使用 git 子模块来完成此操作。

承包商将拥有对作为子模块的存储库的推/拉权限,但对主存储库没有提交权限。

您也可以只使用拉取请求功能并确保他只提交到他想要的文件夹。

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.

苍暮颜 2025-01-15 12:33:06

我还没有这样做,但似乎您可能有 2 个选择:

1)授予承包商对存储库的拉取访问权限(但不是推送权限)。然后他们可以分叉它,在他们的分叉上完成工作(可能在一个分支内?),然后向您发送拉取请求,您需要拉取他/她的更改。缺点是承包商无法将代码发布到服务器无需您的干预(这可能是一个好处,具体取决于)。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文