'Git submodules or different approach?

I'm using a git repository to manage the files I use for teaching. Right now, I have one repository called "teaching" with common files and folders for each course inside (course-1, course-2, course-3, etc.). I thought it would be a good idea to make each course into a submodule so that

  1. I could share the materials of one course with someone without them being able to see the ugliness of all my courses
  2. they could see (only relevant) updates as I make them or contribute their own changes via pull requests
  3. committing would be simpler and unambiguous (e.g., I could just say "Update syllabus" without referring to the specific course).

I do have some materials common to all courses, so I think an overarching "teaching" repository is a good idea. I feel like the submodule approach introduces some (potentially) unnecessary complexity, namely that I am the only one managing each course and I'll be making frequent commits in all of them. Also, submodules are confusing to me and I don't fully understand them. For example, after making a commit in a submodule, do I need to make a commit/push in the root repository (e.g., teaching) to see my submodule changes when I git pull on a different machine? Also, adding/removing submodules is not intuitive to me.

Is there an alternative to submodules that will work here, or do I need to buckle down and learn how to use submodules well?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source