2

Simple situation:

I forked a project from someone else with multiple branches. His/her project changed over time like any other project does. My fork gets more and more outdated especially other branches. To fix this you have to follow the instructions mentioned here.

My Question is:

Is it common to:

  1. Fork a project
  2. Work on it and make merge request until...
  3. ...your project is too outdated and you have to delete the old to make a new fork ?

First, I know how to update my fork. But I see no simple way to just say git magiccommand upstream and my fork gets updated 1:1 with all branches and tags etc.

Is this the normal lifecycle of a fork (fork it, change something, throw away?)

Community
  • 1
  • 1
Rubinum
  • 547
  • 3
  • 18

1 Answers1

1

You could try and git reset --hard mybranch upstream/mybranch, with upstream being a reference to the original repo (that you have forked)

https://cloud.githubusercontent.com/assets/1319791/8943755/5dcdcae4-354a-11e5-9f82-915914fad4f7.png

You would have to do that for every branches.

But it is easier/cleaner to:

  • make a new fork
  • add a remote referencing your old fork and fetch it
  • do some git cherry-picking in order to get back some of the commits you did and that you want to apply on top of the newly updated fork.

Once your PR (Pull Request) is accepted, you now have the option to delete the branch from which the PR was done. That means your fork can be (if there is no more PR) safely thrown away.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Okay, I see that my assumption was not false. Your answer made it even more clear to me. Thank you :) – Rubinum Jan 20 '16 at 09:32