Maintain git repo inside another git repo

后端 未结 4 1624
慢半拍i
慢半拍i 2020-12-07 16:25

Here\'s what I\'d like:

REPO-A
  /.git
  /otherFiles
  /REPO-B
    /.git
    /moreFiles

I want to be able to push all of REPO-A\'s

4条回答
  •  生来不讨喜
    2020-12-07 16:38

    Yes, you can do exactly what you're asking with the file hierarchy you drew. Repo-B will be independant and have no knowledge of Repo-A. Repo-A will track all changes in it's own files and Repo-B's files.

    However, I would not recommend doing this. Every time you change files and commit in Repo-B you'll have to commit in Repo-A. Branching in Repo-B will mess with Repo-A and branching in Repo-A will be wonky (trouble removing folders, etc.). Submodules are definitely the way to go.

提交回复
热议问题