为github创建公共git repo的分支 [英] Create a fork of public git repo for github

查看:165
本文介绍了为github创建公共git repo的分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始使用git和github,我需要一些建议。
我想创建一个公共git repo的分支(如果您感兴趣,可以使用qemu-kvm)。
我打算在github上有一个fork的公共版本和我们团队的开发版本。

I'm just starting to use git and github and I need some advise. I want to create a fork of a public git repo (qemu-kvm in case you're interested). I plan to have a public version of the fork on github and a development version for our team.

我确定有很多方法可以设置它up,但git有时会让我困惑。
我想要做的是......

I'm sure there are many ways to set this up, but git confuses me sometimes. What I'm thinking of doing is ...

在我的开发机器上的特殊官方分支中创建qemu-kvm回购的克隆。允许团队克隆此回购并将更改提交到主分支。当主分支稳定时,我会将代码合并到github分支,并使用它来更新github上的代码。

Create a clone of the qemu-kvm repo on my development machine in a special official branch. Allow the team to clone this repo and commit changes into the master branch. When the master branch is stable, I would merge the code to a github branch and use this to update the code on github.

定期地,我会在官方分支上获取更改,并根据需要将它们合并到我的github分支。

Periodically, I would fetch changes on the official branch and merge them to my github branch as required.

这听起来合理吗?还是有更好的方法来做到这一点?
Thanks,
Steve

Does this sound sensible or is there a better way to do this? Thanks, Steve

推荐答案

它可以工作,但您需要在您的本地环境。

It can work, but you need to manage a special clone on your local environment.

您可以简单地在您的叉子上发布' dev '分支,并要求您的开发人员直接推送在你的fork分支中(将开发人员添加为合作者)

You could simply publish on your fork a 'dev' branch and ask your developer to push directly in that branch of your fork (adding the developers as collaborators)

您将负责克隆GitHub分叉并合并 dev master ,确保它是稳定的并且基于最新的master从最初的repo(所以重新定位你的master分支在 upstream / master ,有点像我的拉取请求已合并,接下来要做什么? / a>)。

然后,您可以将 master 推送到您的分支并进行请求。

You would be in charge of cloning that GitHub fork and merging dev to master, making sure it is stable and based on the latest of master from the original repo (so rebasing your master branch on top of upstream/master, a bit like in "My pull request has been merged, what to do next?").
Then you can push master to your fork and make the pull request.

这篇关于为github创建公共git repo的分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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