如何在GitHub上的多个分叉存储库之间合并? [英] How do I merge between multiple forked repositories on GitHub?

查看:136
本文介绍了如何在GitHub上的多个分叉存储库之间合并?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对编码和Github还是很陌生,因此与分叉存储库的工作方式有些混淆-所以请原谅什么可能是一个基本问题.

I'm still very new to coding and Github and as such am a little confused with how forking repos works - so please forgive what may be a basic question.

整个星期我一直在与不同的配对伙伴一起从事一个项目,而我目前的代码库情况如下:

I've been working on a project with different pair partners all week and my current code base situation is as follows:

我的初始回购- https://github.com/timrobertson0122/yelp_clone

然后分叉了这段代码,并在第二个存储库上继续工作-(无法发布网址)

This code was then forked and work continue on a second repo - (can't post url)

该存储库随后被分叉,并包含我昨天与一位同事合作的最新代码,我不能分叉- https://github.com/curlygirly/yelp_clone-1

That repo was subsequently forked and contains the most recent code, that I worked on with a colleague yesterday, which I can't fork - https://github.com/curlygirly/yelp_clone-1

所以我的问题是如何同步原始存储库?我可以只在指向原始仓库的最新分叉仓库中添加上游内容吗?我需要提交拉取请求吗?

So my question is how do I sync my original repo? Can I just add an upstream to the most recently forked repo that points to the original repo? Do I need to submit pull requests?

谢谢.

推荐答案

您可以将curlygirly的存储库添加为

You can add curlygirly's repo as a remote to your original repo and merge in changes from it just like any other branch. For example, if you want to merge everything on curlygirly's master branch into your original repo's master:

git remote add curlygirly https://github.com/curlygirly/yelp_clone-1.git
git fetch curlygirly
git checkout master
git merge curlygirly/master

如果您愿意,也可以使用拉动请求来执行此操作进行代码审查等.只需打开从curlygirly:master(或任何其他分支)到timrobertson0122:master的请求,然后从那里进行.

You can also do this using Pull Requests if you prefer, want to put it through code review, etc. Simply open a request from curlygirly:master (or any other branch) to timrobertson0122:master and go from there.

关于Git的伟大之处在于,存储库,分支,提交等都只是构建块,您可以按自己喜欢的方式进行管理.您的第一个存储库originmaster并没有什么特别的,因此您可以自由地在任何地方使用代码,以后再将其移动到其他任何地方.

The great thing about Git is that repositories, branches, commits, etc. are all just building blocks you can manage any way you like. There's nothing special about your first repo, origin, or master, so you're free to work on code anywhere, and move it anywhere else later.

这篇关于如何在GitHub上的多个分叉存储库之间合并?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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