Storing generated files in Git

前端 未结 3 1850
时光说笑
时光说笑 2021-02-05 20:20

We have a reasonably large, and far too messy code base that we wish to migrate to using Git. At the moment, it\'s a big monolithic chunk that can\'t easily be split into smalle

3条回答
  •  -上瘾入骨i
    2021-02-05 20:44

    I would keep these in a separate repository to the source files. You can use 'git submodules' to keep a reference between the two; so the 'compiled libs' becomes the parent and the source becomes the submodule. That way, when you commit the libs you commit a reference to the exact point of the source code at the time.

    Further, since developers don't need the full history, you can use git clone --depth 1 libs.git which gives you only the latest version of the libs. It doesn't pull further history, and doesn't allow you to commit (which is OK since the server should be doing that for you) and you'll give them access to the latest versions (or whatever branch you specify on the clone command with -b).

    Ideally you don't want the main git repository containing, or pointing to, the binary repository.

提交回复
热议问题