What is the proper git workflow for basing a project off a 'seed' repo?

Viewed 4910

As an example: suppose you have a personal project like Angular Seed (which is a starting point for an Angular project https://github.com/angular/angular-seed).

Now you want to use that as a starting point for a project (say an online photo album).

You shouldn't just create a branch because you're not making a variation of the seed project. But github won't let you fork it if it's your own repo.

So what is the workflow to create a clone that can still pull in changes form the original seed project? I thought that was a fork.

5 Answers

I think the right answer here is to use something like Yeoman Generators. (http://yeoman.io/) You want to use the git repo with your seed project as a generator. It wouldn't allow you to continually pull in changes from the seed project though.

The solution of using two remotes works, but eventually the projects will diverge enough that will make keeping those projects in synch very difficult.

What you could do is:

  • initialize a new repo
  • reference your angular repo as a submodule of that new repo
  • push that new repo in your GitHub space.

That way, your new project has:

  • a subfolder representing your seed project (which you don't modify)
  • all your data specific to your project.

My issue with that is that a seed project isn't a library. It doesn't live in a subdirectory of a project. It IS the project when you start, and you build from there.

Then a simple clone that you push back to your new repo is enough.
But that won't keep any "fork" relationship between your two GitHub repos.
You will have to pull one and push to the other through a local clone.

Related