Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

github

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.

like image 378
Dan Bough Avatar asked Mar 31 '13 20:03

Dan Bough


1 Answers

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.

fork

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.

like image 86
VonC Avatar answered Oct 05 '22 02:10

VonC