Structure in git with multiple websites

后端 未结 3 1810
一向
一向 2021-02-19 12:54

I have a website that i keep in git. It is a asp.net webforms website (but that is probably unimportant to this question).

The website is used by our customer for 2 (in

3条回答
  •  深忆病人
    2021-02-19 13:55

    I might make separate "Site" and "Common" directories, with "Common" containing symlinks at strategic points and one or both a submodule, like so:

     Project
     |==.git
     |--Site
     |  |--.git
     |  \--Website
     |     |--Styles
     |     \--web.config
     \--Common
        |--.git
        |--BackOffice
        |  \--UI
        |--BackOffice.UI
        |  \--WebControls
        |--BackOfficeTests
        |--Deployment
        |  \--db
        |--BusinessLogicLayer
        |  |--bin
        |  |--obj
        |  \--Properties
        |--scripts
        \--Website
           |--admin
           |--App_Browsers
           |--App_Code
           |--App_Data
           |--Styles -> ../../Site/Website/Styles
           \--web.config -> ../../Site/Website/web.config
    

    That's not the only layout that would serve -- for instance, if it should be easy to have different sites pick and choose what gets tweaked you could preserve your current layout, adding the "Common" subproject and symlinking anything you use from it unchanged, like so:

     Site
     |==.git
     |--BackOffice -> Common/BackOffice
     |--BackOffice.UI -> Common/BackOffice.UI
     |--BackOfficeTests -> Common/BackOfficeTests
     |  [...]
     |--Website
     |  |--admin -> ../Common/Website/admin
     |  |--App_Browsers -> ../Common/Website/App_Browsers
     |  [...]
     |  |--Styles
     |  \--web.config
     \--Common
        |--.git
        |--BackOffice
        |  \--UI
        |--BackOffice.UI
        |  \--WebControls
        |--BackOfficeTests
        |--Deployment
        |  \--db
        |--BusinessLogicLayer
        |  |--bin
        |  |--obj
        |  \--Properties
        |--scripts
        \--Website
           |--admin
           |--App_Browsers
           |--App_Code
           |--App_Data
           |--Styles.example
           \--web.config.example
    

    The more I look at it the more I like that last one better.

提交回复
热议问题