git 中的一个主存储库的多个远程源

Multiple remote sources to one main repository in git

我使用 git 和 dropbox 来记录我在学校从事的项目。我每个学期都会选修某些课程,但我会为每门课程创建一个新文件夹。我用 git 备份了这些课程中的所有 material。我想知道是否有办法为多个源存储库(例如,每门课程的本地文件夹)使用相同的主存储库(例如 dropbox 文件夹)。

结构类似于:

~/Users/Me/dropbox/git --> (main repository)

~/Users/Me/Courses/Course_1/. (This is the first course) ~/Users/Me/Courses/Course_2/. (This is the second course)

我希望能够从 Course_1 和 Course_2 推送到 git 文件夹。但是,我想让它们分开,这样当我从 Course_2 内部拉出时,它不会从 Course_1 拉出所有 material 。有办法吗?

您可以简单地为每门课程创建一个 repo。
这些将通过 Dropbox 上每门课程的一个裸仓库进行镜像。

这样,您就可以克隆您需要的课程(repo)。

话虽如此,我已经看到 issues with bare repo on Dropbox before
我更喜欢使用 Dropbox with git bundles (one file per repo).