Using git and submodule, what's a good folder structure?

前端 未结 3 739
轮回少年
轮回少年 2021-01-12 03:19

I use git with submodules, and I\'ve hard time to figure out how to organize my files. I develop in PHP, and use unit testing. So right now, I use this organization for each

3条回答
  •  深忆病人
    2021-01-12 04:06

    What I did when faced with this problem was to create a folder called vendors and place all the submodules into that. Then I symlinked using relative paths the directories to the locations I wanted them in my code. You can commit the symlinks to git and they will still work when other pull the repository. Of course this only works if you are using a *nix based OS.

    For example:

    modules/
    vendor/module1/src/
    

    Could be symlinked like so (from the modules directory):

    ln -s ../vendor/module1/src module1
    

    Not sure if this solves your problem or not.

提交回复
热议问题