我该如何更改我从哪个GitHub项目中分离出来? [英] How do I change which GitHub project I forked from?

查看:295
本文介绍了我该如何更改我从哪个GitHub项目中分离出来?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我分出了一个项目,做了一些修改,并接受了一个拉取请求。但是现在,我分叉的项目移动到另一个存储库,并且是该存储库的一个分支。


$ b 即:

 原件 - > MyFork 

现在:

  NewOriginal  - >原创 - > MyFork 

我如何得到它?

  NewOriginal  - > MyFork 


解决方案

在本地,您可以更改原始目标资源库位于。通常这个仓库名为 upstream ,所以你可以这样做:

  git remote set-url upstream git://example.com/NewOriginal.git 

取决于您使用的是什么主机(即,你的叉子在哪里),可能会有一些额外的内部链接,你不能那么容易地改变。例如,在Github上,分支直接与您从中分出的原始链接相关联。在这种情况下,您需要再次分派新项目,并使用新分支。



在这种情况下,您可以轻松更改 origin 存储库的URL ,并将您之前在旧叉中更改的所有内容都推送到您的新叉。


I forked a project, made some changes, and got a pull request accepted. But now, the project I forked moved to another repository and is a fork of that repository.

That is:

Original -> MyFork

Now:

NewOriginal -> Original -> MyFork

How would I get it to the following?

NewOriginal -> MyFork

解决方案

Locally you can just change the target of the original repository is located at. Usually that repository is called upstream, so you would do this:

git remote set-url upstream git://example.com/NewOriginal.git

Depending on what host you are using (that is, where your fork is located), there might be some additional internal links, you can't change so easily. For example on Github, the fork is directly linked to the original you forked from. In that case you need to fork the new project again, and work with the new fork.

In that case however you can easily change the URL of the origin repository as well, and just push everything you changed before in your old fork into your new fork.

这篇关于我该如何更改我从哪个GitHub项目中分离出来?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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