简体   繁体   中英

Best Practice when Forking a Repo on Github to Start Your Own

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 (ie 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM