eric
eric

Reputation: 8088

Number of repositories for small, but multidirectory, project?

I'm writing code corresponding to a book, so the directory structure is as follows:

BookName/
    Chapter1/
        program11.py
        program12.py
    Chapter2/
        program21.py
        program22.py
    .
    .
    Chapter N/
        programN1.py
        programN2.py

I just want to focus on writing the code, not becoming a Git expert (I am a Git noob), but I also want to follow good practices. I am not sure if I should make each chapter a submodule (each chapter's code is independent, so the chapters will not need to be updated simultaneously). Alternaltively, should I just treat BookName as a single repository? Each chapter will not have more than 10 or so small files (all less than 200 lines of code). So it seems that given the small project size, and learning curve required, breaking it into submodules may be counterproductive.

That said, it would be nice if people at GitHub could pull individual chapters if they want. But even if I set it up that way, will enough users know how to pull submodules, or would I be making it prohibitively complicated for anyone to pull my code? Will it be more likely for people to pull it if I just go with the "one big project" approach?

A lot of the relevant stuff I have read seems to be for much larger-scale professional, complicated projects than mine. Mine is small-scale, and once done it will change very little, and will likely never be more than 4 MB total (compared to megaprojects with multiple GB).

Here are the related links I was able to find:

GIT repository layout for server with multiple projects

Best Practice for Git Repositories with multiple projects in traditional n-tier design

http://git-scm.com/book/en/Git-Tools-Submodules

Using two git repos in one folder

http://sethrobertson.github.io/GitBestPractices/

Split of a directory from a git repository and have a SMALL git repo

Upvotes: 4

Views: 214

Answers (1)

VonC
VonC

Reputation: 1327014

It is best to keep the all project in one git repo.

A book like "Learn Javascript" follows that organization, and can be published through gitbook.io.

gitbook.io (repo GitHub) is a great project to write a book without being a git expert. See features for Authors.

Upvotes: 4

Related Questions