将Github fork添加到现有的存储库 [英] Add Github fork to existing repository

查看:126
本文介绍了将Github fork添加到现有的存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照给定的说明(http://octopress.org/docs/setup/)设置了一个Octopress项目,该项目将创建一个Github存储库,并在您的机器上创建一个本地存储库。在本地机器上,您将远程设备添加到原始的Octopress存储库,然后发出git pull命令。然后你在你的Github仓库中添加一个远程服务器,这样你就可以将你的更改推送到你的仓库。



所有这些都可以运行,但它不会创建原始项目的一个分支,这意味着没有明显的(以新手)方式向原始Octopress存储库发出pull请求。



有没有办法让我将原始Octopress存储库的一个分支添加到Github上该存储库的实例?

如果没有办法,我可以安全地删除我的Github Octopress实例,在Github上分出原始代码,然后从我的本地存储库中添加一个新的远程新分叉的Octopress?尽管人们倾向于将其在Github上的回购看作是官方回购,但请记住,这是一个社会的区别,而不是技术性的。从git的角度来看,每个回购都是平等的。这意味着只要你把每一个提交都放到你的本地仓库中,你就可以安全地删除Github上的仓库。然后,只需在Github上分发Octopress项目,将其设置为本地回购的远程设备,然后推送。 Git不关心你最初得到的任何回复。它只是工作。


I setup an Octopress project following the given instructions (http://octopress.org/docs/setup/) which have you create a Github repository, and create a local repository on your machine. On your local machine you add a remote to the original Octopress repository and then issue a "git pull" command. Then you add a remote to your Github repository so you can push your changes to your repository.

All of this works as far as it goes, but it doesn't create a fork of the original project, meaning there's no obvious (to a newbie) way to issue a pull request to the original Octopress repository.

Is there a way for me to add a fork of the original Octopress repository to my instance of that repository on Github?

If there isn't a way, can I safely delete my Github instance of Octopress, fork the original on Github, and then add a new remote from my local repository to the newly forked Octopress?

解决方案

Although people tend to think of their repo on Github as the "official" one, remember that's a social distinction and not a technical one. From git's point of view every repo is on equal terms. That means as long as you have pulled every commit into your local repo, you can safely delete the one on Github. Then just fork the Octopress project on github, set it up as a remote on your local repo, and push. Git doesn't care which repo you originally got any given commit from. It "just works."

这篇关于将Github fork添加到现有的存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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