更新GitHub存储库的修改版本 [英] Keep a modified version of a GitHub repository updated

查看:151
本文介绍了更新GitHub存储库的修改版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在过去的几天里,我一直在为Mongoose添加更新验证器。我认为这在我使用mongodb的方式中非常关键;这就是为什么我让自己有很多睡眠剥夺,并实施它:

https://github.com/LearnBoost/mongoose/pull/1256



合法的(现在不可能有​​100%一致的验证器,因为现在猫鼬验证者期望完全访问已加载的文档,这对于更新是不可能的),伟大的Mongoose维护者Aaron可能最终不会接受这个上游。



这绝对不是问题:猫鼬是亚伦的宝宝,他显然有很多东西是正确的;在同一时间...嗯,我确实需要更新验证。



我对git没有希望,尽管我已经掌握了它的要点。现在,我克隆了Mongoose的主要repo,以便我可以提交我的pull请求:



https://github.com/mercmobily/mongoose



我明显使用这个开发版(因为它有好东西)。这些修改实际上是非常本地化的(只有model.js中的一大块代码和query.js中的两个小本地化块)。但是,我很担心,因为猫鼬是非常积极的开发,我真的不想错过最新的奶油。

所以,问题:我该如何保持我的存储库与主要的存储库同步,每天都有?或者也许是每周?合并我的修改应该很简单,因为它们不应该影响Mongoose作为一个整体。



我希望最终我不必这样做,但我是为最坏的做准备:D

谢谢!

解决方案

你跟上远程仓库变化的方式是你1)在你的本地仓库仓库添加一个新的远程仓库,2)为这个新的远程仓库获取更新,3)合并/重新定义你的仓库到这些变化。

查看这些文章:
如何与远程Git存储库同步?
http://gitready.com/advanced/2009/02/11/pull-with-rebase.html


Over the last few days, I have been working on adding update validators to Mongoose. I consider this absolutely critical in the way I use mongodb; this is why I got myself a lot of sleep deprivation, and implemented it:

https://github.com/LearnBoost/mongoose/pull/1256

For reasons that are very legitimate (it's impossible to have 100% consistent validators as right now mongoose validators expect full access to the loaded doc, something that is impossible for an update), Aaron, the great Mongoose maintainer, might end up not accepting this upstream. See the discussion in the pull request if you are interested.

This is absolutely not a problem: Mongoose is Aaron's baby, and he obviously got a LOT of things right; at the same time... well, I do do need update validation.

I am hopeless with git, although I am getting the gist of it. Now, I cloned Mongoose's main repo so that I could submit my pull request:

https://github.com/mercmobily/mongoose

I am obviously using this one for development (since it has the goodies). The modifications are really quite localised (only a big chunk of code in model.js and two small localised chunks in query.js). But, I am worried because Mongoose is very actively developed and I don't really want to miss out on the latest cream.

So, the question: How can I keep my repository syncronised with the main one, on a day to day basis? Or maybe weekly basis? Merging my modifications should be straightforward, as they shouldn't affect Mongoose as a whole.

I hope I won't have to do it in the end, but I am preparing for the worst :D

Thanks!

解决方案

The general way you keep up with changes in a remote repo is that you 1) add a new "remote" repo in your local git repo, 2) fetch updates for that new remote repo, and 3) merge/rebase your repo to these changes.

Check these articles out: How to sync with a remote Git repository? http://gitready.com/advanced/2009/02/11/pull-with-rebase.html

这篇关于更新GitHub存储库的修改版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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