TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Best way to source control multiple repos building upon each other

1 点作者 msadowski将近 3 年前
Hi HN!<p>I&#x27;m working on an online course that currently has four chapters. The students need to be able to start the project from any chapters they want.<p>Ideally, I should be able to provide partial&#x2F;full solutions as a repository (or an archive) to students. So far, I&#x27;ve separated the work into two directories per chapter (one for the full solution, one for the partial).<p>The problem is - if I want to modify something in any place and want to keep it consistent, I need to make a change in 8 directories.<p>I&#x27;ve been thinking about the best way to organize it but can&#x27;t think of any approach that would be simple and would allow me to change the code in a single place.<p>I was thinking about submodules, but the projects are not clear-cut, sometimes the same files will be modified in multiple chapters.<p>I would hugely appreciate any thoughts you might have!

1 comment

dave4420将近 3 年前
Write a script that builds the repo from scratch. (Perhaps by applying diffs against the previous directory.)<p>Then you just need to update an rerun the scripts (or one of the files&#x2F;diffs it depends on.)<p>Keep this script and its helper files in a separate repo.