Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to synchronize a GitHub repository and multiple Gists

I am developing a pretty large JavaScript library (Formula.js) of functions (450+). Most of them are pretty independent from each other and totally self-contained, or make use of well-known third-party libraries (Moment.js for example). In order to support discussions and manage contributions at the function level rather than at the library level, I created one Gist per function (Cf. CONVERT Gist), and one repository for the entire library. This makes it easy to include the code of a function in the function's documentation (Cf. CONVERT documentation).

My question is: how do I keep the master repository synchronized with the Gists?

The solution should:

  • allow changes to be made from the master repository and from the individual Gists
  • automate the inclusion of copyright headers on the individual Gists
  • automate the inclusion of comments related to third-party libraries on the individual Gists

Additional thoughts:

I could not find many examples of projects being managed that way. I'm also rather unexperienced with Git. Therefore, the workflow I'm suggesting might be totally flawed, or introduce unwanted complexity. Any thoughts on possible best practices for keeping things under control are much welcome.

like image 476
Ismael Ghalimi Avatar asked Jan 26 '13 15:01

Ismael Ghalimi


1 Answers

Seeing as each gist is in fact a git repository, you could use the git submodule feature to include them all in your primary GitHub repository.

Have a look at this page from the book, http://git-scm.com/book/en/Git-Tools-Submodules , it even has a section on so-called Superprojects.

like image 117
Alex Stuckey Avatar answered Sep 19 '22 11:09

Alex Stuckey