在Github中管理私人存储库 [英] Managing private repositories in Github

查看:106
本文介绍了在Github中管理私人存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个很基本的问题,我正试图在Github上解决这个问题。我有一个私有存储库(通过一个组织),我需要找出设置它的最佳方法,这样我的团队就可以推送到主分支下的分支,而不是主分支本身。



我知道一种方法是拥有两个独立的私有存储库,一个是主存储库,另一个是暂存存储库。然后只有我可以访问主回购,但团队可以访问分期回购。然后我会合并从暂存到主的更改。



但我不确定如何去创建暂存 主回购,也没有如何将更改合并回主。



下面是我正在努力完成的一个粗略图表(上图中, masterrepo,在行下面,stagingrepo):

  master(只有我)
- ---------------------------
- >分期(团队)
- >功能1
- >团队成员1
- >功能2
- >团队成员2
- >团队成员3

有什么想法?

解决方案

对于DVCS,分支和发布(推/拉)两个正交概念



这意味着你不要关心你的合作者推动什么分支机构,只要他们在GitHub上推动他们自己的(分叉式)私人回购。

你是唯一能够导入他们建议的(通过拉取请求)在您选择的分支中进行私人回购。

I'm pretty new to Git/Github, so please bare with me.

I have a pretty basic problem I'm trying to solve on Github. I have a private repository (via an Organization), and I need to figure out the best way to set it up so that my team can do pushes to a branches beneath the master branch, but not the master branch itself.

I know one way would be to have two separate private repositories, one which would be the "master" repository, and the other that would be the "staging" repository. And then only I would have access to the "master" repo, but the team would have access to the "staging" repo. And then I would merge the changes from "staging" to "master".

But I'm not sure I understand how to go about creating the "staging" repo off the "master" repo, nor how to merge changes back into "master".

Here is a rough diagram of what I'm trying to accomplish (above the line, "master" repo, below the line, "staging" repo):

master (only me)
-----------------------------
--> staging (team)
    --> feature 1
        --> team member 1
    --> feature 2
        --> team member 2
        --> team member 3

Any ideas?

Thanks in advance.

解决方案

With a DVCS, branching and publication (push/pull) are two orthogonal concepts.

That means you shouldn't be concerned to what branches your collaborators are pushing to, as long as they are pushing to their own (forked) private repo on GitHub.
You are the only one able to import what they propose (through pull request) in the branch of your choosing in your private repo.

When I see lifecycle steps ("staging", "testing", "QA", "..."), I prefer setting up a separate repo for each step I need, in order to have as many branches as I want in each of those separate repos.

这篇关于在Github中管理私人存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆