在Github上分配回购以开始自己的最佳实践 [英] Best Practice when Forking a Repo on Github to Start Your Own

查看:168
本文介绍了在Github上分配回购以开始自己的最佳实践的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

github上有一个我想要建立的回购。这样做的最佳做法是什么?这是我所做的:



1)分叉回购。
2)开始新的回购。
3)将分叉回购的远程起源网址更改为新回购。
4)将新回购的本地副本推送到github。



这给了我新的回购起点,但是,我仍然有原始回购的提交历史等等。保留这种东西的最佳做法/礼仪是什么(而不是删除提交历史和从头开始)。

原作者将无论我做什么,都能获得完整的信誉,但看起来提交历史可能会混淆想要使用我的回购的人。


一旦我开始添加特性/代码,它将会不同,但提交历史将是相同的。是预期的吗?


是的,但叉子背后的真正想法是可以让您回到<通过 upstream repo(即您在GitHub端分叉的回购) rel =nofollow noreferrer> pull request



这就是为什么您通常不会将原始网址更改为新回购的原因,您也注册一个远程仓库'上游',指的是您已分叉的原始仓库。



另一个想法,即使你不回馈,是以跟上上游的任何进化:您可以 git fetch upstream ,并合并或重新绑定来自上游的任何新提交你想。


There is a repo on github that I would like to build off of. What is the best practice for doing this? Here is what I've done:

1) Fork the repo. 2) Start a new repo. 3) Change the forked repo's remote origin url to the new repo. 4) Push the new repo's local copy to github.

This gives me a 'starting point' for the new repo, however, I still have the original repo's commit history etc. What's the best practice /etiquette for keeping things like this (as opposed to deleting the commit history & starting from scratch.)

The original author will get full credit regardless on what I do, but it seems the commit history might confuse folks who want to use my repo.

解决方案

Once I start adding features / code, it will be different, but the commit history will be the same. Is it something that is expected?

Yes, but the true idea behind the fork is the possibility for you to contribute back to the upstream repo (i.e. the repo you have forked on GitHub side), through pull request.

That is why you usually don't just change the url of origin to the new repo, you also register a remote repo 'upstream' referring to the original repo you have forked.

The other idea, even if you don't contribute back, is to keep up with any evolution from upstream: you can git fetch upstream, and merge or rebase whatever new commits from upstream you want.

这篇关于在Github上分配回购以开始自己的最佳实践的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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