Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

github

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.

like image 364
Mark Bolusmjak Avatar asked Dec 04 '13 16:12

Mark Bolusmjak


2 Answers

I just found this answer https://stackoverflow.com/a/4096529/131227 as well as a comment (git workflow - using one repo as the basis for another) which together lead me to a solution I like.

git clone -o boilerplate ssh://[email protected]/user/proj.git new_proj
The -o boilerplate renames the origin to boilerplate which can still be used to pull changes from.

Create your new empty github new_proj repo. Then
git remote add origin ssh://[email protected]/user/new_proj.git

like image 79
Mark Bolusmjak Avatar answered Oct 21 '22 14:10

Mark Bolusmjak


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.

like image 44
Kyle Boon Avatar answered Oct 21 '22 14:10

Kyle Boon