version control - Storing generated files in Git -
we have reasonably large, , far messy code base wish migrate using git. @ moment, it's big monolithic chunk can't split smaller independent components. code builds large number of shared libraries, source code interleaved can't cleanly separated separate repositories @ moment.
i'm not concerned whether git can cope having code in single repository, problem need version both source code , many of libraries built it. building scratch takes hours, when checking out code, developers should precompiled versions of these libraries save time.
and use advice. libraries don't need 100% date (as maintain binary compatibility, , can rebuilt individual developer if necessary), i'm looking ways to avoid cluttering our source code repository countless marginally different versions of binary files can regenerated source anyway, while still making libraries accessible developers don't have rebuild scratch.
so i'd way achieve following.
- the libraries generated our build server on regular basis, commit them git repository. developers should treat these files read-only (pull latest version, , when necessary, rebuild in place, don't commit new versions), , ideally, git should enforce this. (in particular, developer running quick
git commit -ashouldn't end accidentally polluting repository new revision of these generated files) - keep these files in separate repository, source code won't have carry around these generated binary files perpetually (since they're convenience cut down on compilation time, they're not necessary).
of course, @ same time, process of using these should smooth possible. when checking out source, libraries built should follow (or @ least, easy get). , when committing, shouldn't possible accidentally commit new versions of these libraries, because recompiled , have different timestamp embedded.
i've been looking @ option of using git's submodules, creating "super" repository containing source code, , 1 or more submodules generated libraries, far, seems bit clumsy , fragile taste. seems don't prevent developer committing changes directly submodule, causes things break further down line (while playing around submodules, i've ended more detached heads care count).
considering virtually our developers new git, may end wasting more time saves us.
so our options? submodule approach sound sensible git gurus out there? , how "tame" it, it's easy use (and hard mess up) possible our developers?
or there entirely different solution haven't considered?
i should mention i've used git couple of days, i'm pretty newbie myself.
i not git-guru, guess solved submodules. add precompiled binaries submodules, them 1 has this:
git submodule update --init how ignore changes in submodules described here. so, if dev rebuilts not committed git commit -a , not added git add .. have make sure not commit within submodule directly. vimcast shows how use submodules keeping vimfiles under controll, should easy adapt problem.
Comments
Post a Comment