Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to maintain a Github fork of a popular project

Tags:

I forked a popular github project to make certain minor adjustments for my needs. However I want to keep my fork up to date with the master repo. What I did initially was fork via the github ui, then pushed my changes directly to this fork from my dev env. I'm not entirely convinced I should have done this as I think it makes pulling updates from the master repo difficult.

What's the recommended method for maintaining a fork in this fashion and what do I have to change about my current setup?

like image 971
user1561108 Avatar asked Jan 11 '13 23:01

user1561108


People also ask

How do I keep my git fork up to date?

From GitHub: Go to your fork, click on Fetch upstream and then click on Fetch and merge to directly sync your fork with its parent repo. You may also click on the Compare button to compare the changes before merging.

Is it legal to fork in GitHub?

The TOS states you agree to allow viewing and forking. It doesn't state that you agree to allow redistribution or use. If the terms don't explicitly state that you allow those things, then unless your license allows them they aren't allowed.


1 Answers

You can configure to remote repositories to use in git. In the project cloned from your fork, type the following comand: git remote add name url where name is a alias to a url that represents the master repo.

With that, to bring the new updates from the master repo, just type: git pull name master. To send the changes to your fork repo: git push origin master.

like image 113
William Seiti Mizuta Avatar answered Sep 30 '22 17:09

William Seiti Mizuta