Github项目旨在展示进化,如何管理叉子/分支? [英] Github project, intended to show evolution, how to manage forks/branches?

查看:134
本文介绍了Github项目旨在展示进化,如何管理叉子/分支?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个GitHub项目,它执行相同的操作(一个简单的RogueLike游戏演示,一个<$

我计划让它更加复杂,并且添加相同的新语言(例如,c $ c> @ 在硬编码映射中移动)功能,以分隔的步骤执行每个实现。


  1. 尽我所能做到这一点

  2. (适用于语言...)

  3. 简单的映射生成器而不是硬编码

  4. 等等。更多步骤

目的也是为了能够做一些事情,例如让人们能够用不同的语言贡献实现对于任何步骤,如果他们希望/改进实现等,但看看文档,我应该能够弄清楚如何合并这些返回/使用拉取请求



<现在,考虑到所有这些,我的主要问题是,对于每一步我应该分叉还是分支项目?

另外,是否可以让git保留本地每个分支的副本?因为它似乎只是保持你现在正在工作的分支,并且还有很多摆弄同步它们的方法......或许这只是因为我对git和github不熟悉,并且并不完全舒适所有的命令呢。还是因为我应该分叉而不是分枝?我尝试做一个分支开始做第2阶段,当试图在两个分支之间更改我的本地副本时,有很多摆弄...



请温柔和我一样,我是git / GitHub的新手,我尝试过使用谷歌搜索和搜索StackOverflow,但我不确定我在找什么。

解决方案

您必须分拣项目



分叉意味着:在GitHub一侧进行克隆,这使您可以为 SimpleRL 项目创建自己的代码库(不能向其中添加代码)直接推送,因为你不是直接贡献者之一)



使用分支,您将能够:


  • 在本地克隆它并创建您想要分离重构/增强的分支

  • 将这些分支中的任何一个推回到 SimpleRL 在GitHub上分叉(确保其他人可以看到这些新的特征并且克隆/测试它们自己)
  • 使用从初始 SimpleRL 回购的任何进化来更新您的分支(您将需要将它添加为远程文件)。 http://help.github.com/pull-requests/ =nofollow>通过pull请求,假如你的新代码与原始代码不是太多 。这不是强制性的。如果你的发展既庞大又更好,你在GitHub上的分支最终可能会成为 SimpleRL 项目的新的默认引用。

>

I have a GitHub project which does the same thing (a simple RogueLike game demo, an @ moving around a hardcoded map) in several different languages:

I plan to make it more sophisticated and add the same new functionality to each implementation in delimited steps.

  1. As simple as I could make it
  2. Naive OO (where appropriate for the language...)
  3. Simple map generator rather than hardcoded
  4. Etc. more steps here

The intent is also to be able to do things like allow people to be able to contribute an implementation in a different languages for any of the steps if they wish/improve an implementation etc., but looking at the docs I should be able to figure out how to merge these back in/use pull requests

Now, given all that, my main question is, for each step should I fork or branch the project?

Also, is it possible to have git keep a local copy of each branch? Because it seems that it just keeps the branch you're working on at the moment and there's a lot of fiddling around to sync them back and forward... or maybe that's just because I'm new to git and github and not completely comfortable with all the commands yet. Or is it because I should be forking rather than branching? I tried doing a branch to start doing stage 2 and there was a lot of fiddling around when trying to change my local copy between the 2 branches...

Please be gentle with me, I'm new to git/GitHub, and I have tried Googling and searching StackOverflow but I'm not really sure what I'm looking for.

解决方案

You have to fork the project.

Forking means: cloning on the GitHub side, which allows you to have your very own code base for the SimpleRL project (to which you cannot push directly, because you aren't one of the direct contributors)

With a fork, you will be able to:

  • clone it locally and make any branch you want to isolate your refactoring/enhancements
  • push any of those branch back to your SimpleRL fork on GitHub (ensuring that others can see those new features and clone/test them themselves)
  • update your fork with any evolution from the initial SimpleRL repo (you will need to add it as a remote).
  • contribute back through pull request, provided your new code isn' too much different from the original one. This is not mandatory. If your evolutions are both massive and better, your fork on GitHub could end up being the new default reference for the SimpleRL project.

这篇关于Github项目旨在展示进化,如何管理叉子/分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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