Is it possible to have a git repo inside another git repo

前端 未结 3 757
孤城傲影
孤城傲影 2020-12-14 12:24

I have a django project managed with git. I am git pushing it to my host. Now, I want to be able to push just one of the directories (inc. all sub dirs) to another git repo.

3条回答
  •  [愿得一人]
    2020-12-14 12:37

    Have you looked into git submodules? It allows git repositories to cleanly nest, but remain fully independent.

    This means you can have a subdirectory with a different remote url for push/pull and different commit tree+log without cluttering up the main project.

    https://git.wiki.kernel.org/index.php/GitSubmoduleTutorial

提交回复
热议问题