Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Post History

55%
+3 −2
Q&A How should we share some content between two otherwise-independent git repositories?

First off, all the things @meriton said, I think overall you would be better in a single repository as your docs and code should be changing at the same rate (or should be). Having said that if you...

posted 3y ago by staticvoid‭  ·  edited 3y ago by staticvoid‭

Answer
#2: Post edited by user avatar staticvoid‭ · 2020-08-19T03:11:29Z (over 3 years ago)
  • First off, all the things @meriton said, I think overall you would be better in a single repository as your docs and code should be changing at the same rate (or should be).
  • Having said that if you do have two independent pieces of software which share a common piece of code you would be better to use a package system to bundle and install your shared code. This is language dependent, but examples would be npm (javascript), nuget (.NET), pip (python) etc.
  • The reason you want a package over a git submodule is that you want each independent repo to be in control of its own build status. For example if a change happens in a git submodule it has a potential to break downstream repos. This sucks. Instead the behaviour you want is for the downstream repos to opt into new versions of the module. This means that if a failure occurs it is initiated by the maintainers of the repo, and at a time where its clear why the failure occurred.
  • There are some other patterns you can apply to this in really specific situations around requiring consistency but these are probably way more than you need. Heres an article I wrote about this a few years ago https://blog.staticvoid.co.nz/2017/library_vs_microservice/
  • First off, all the things @meriton said, I think overall you would be better in a single repository as your docs and code should be changing at the same rate (or should be).
  • Having said that if you do have two independent pieces of software which share a common piece of code you would be better to use a package system to bundle and install your shared code. This is language dependent, but examples would be npm (javascript), nuget (.NET), pip (python) etc.
  • The reason you want a package over a git submodule is that you want each independent repo to be in control of its own build status. For example if a change happens in a git submodule it has a potential to break downstream repos. This sucks. Instead the behaviour you want is for the downstream repos to opt into new versions of the module. This means that if a failure occurs it is initiated by the maintainers of the consuming repo, and at a time where its clear why the failure occurred.
  • There are some other patterns you can apply to this in really specific situations around requiring consistency but these are probably way more than you need. Heres an article I wrote about this a few years ago https://blog.staticvoid.co.nz/2017/library_vs_microservice/
#1: Initial revision by user avatar staticvoid‭ · 2020-08-19T03:09:41Z (over 3 years ago)
First off, all the things @meriton said, I think overall you would be better in a single repository as your docs and code should be changing at the same rate (or should be).

Having said that if you do have two independent pieces of software which share a common piece of code you would be better to use a package system to bundle and install your shared code. This is language dependent, but examples would be npm (javascript), nuget (.NET), pip (python) etc. 

The reason you want a package over a git submodule is that you want each independent repo to be in control of its own build status. For example if a change happens in a git submodule it has a potential to break downstream repos. This sucks. Instead the behaviour you want is for the downstream repos to opt into new versions of the module. This means that if a failure occurs it is initiated by the maintainers of the repo, and at a time where its clear why the failure occurred.

There are some other patterns you can apply to this in really specific situations around requiring consistency but these are probably way more than you need. Heres an article I wrote about this a few years ago https://blog.staticvoid.co.nz/2017/library_vs_microservice/