Wednesday 15 May 2013

github - Maintaining git repo containing other cloned git repo -



github - Maintaining git repo containing other cloned git repo -

i working on website using sharelatex(github) contains other repositories used build main project. cloned main repository , did grunt install used download repositories.

but problem need alter code in both main repository , downloaded ones.

since these projects can new updates want merge changes well. need maintain repo, when force changes github shows changes in main repo.

i came across submodules in git since main project not contain submodule types unable utilize that.

for example:

there repo web used in main project. begin edits in files in web. need these changes reflect in remote repository others can utilize them.

now suppose after time of import update web repo available, how should utilize that?

i come in grunt install in command line download repo. not create submodule clones repo folder, subsequently ignored main git repo.

the question might seem unclear tried best explain problem.

in nut-shell:

i want not perform changes in both main , other repo that's involved, pull , merge other repos, well, when updates available.

i need maintain remote repo of project.

i working on website using sharelatex(github) contains other repository used build main project. [...] came across submodules in git since main project not contain submodule kind of thing unable utilize that.

actually, have submodule. that's nested repository is, , (i'm serious this) far need understand grok submodules, that's all there submodules. understand submodules, imagine have nested repository (you do) , think administrative requirements, needs done back upwards setup in dvcs.

for starters, when people clone project uses submodules repo you've decided contains published commits, clone won't subproject repository (certainly shouldn't private , god-knows-what-you've-done-to-it version). have subproject repo 1 of own published repositories.

how tell people fetching commits necessary subproject commits? plainly, have drop note somewhere in committed file saying "here's repo should have needed $subproject commits". git submodule has settled on .gitmodules conventional place store notes this.

next up: well, others if url handed them goes offline? they're plainly going need utilize repo. hence, .gitmodules suggestions, git submodule command uses current values in .git/config, git submodule init has populated suggested ones in .gitmodules`.

git submodule's operations all this. forget it. don't bother looking @ command until need little assistance doing have found needs doing. start knowledge, simple fact, submodule nil more nested repo, , project using commits nil more commit id that's supposed somewhere in nested repo. that's it. that's submodule is.

as run across tedious tasks need doing, git submodule subcommand them you. don't have utilize subcommand. subcommand doing automating straightforward tasks laborious otherwise. it's toolkit doing whatever need do, , there's no way on earth or should impose arbitrary , sufficient (<-- that's hard part) abstraction on in world. it's grab-bag.

that said, there 1 of import safety play git submodule update , git submodule add perform when git clone you. repositories conventionally have actual repo content under [sub]project toplevel .git, if check out branch doesn't have subproject there or otherwise need or want subproject gone, .git go away -- not want when holds not checked out content entire actual repo. when git submodule update initial clone, hoists submodule's .git directory handy (and arbitrary) little nook in containing project's repo, , replaces .git directory moved out of submodule .git file containing relative path moved directory.

to initial hoisting done on repo have, move out of current repo, add together , update wherever set it, , prepare upstream urls in .gitmodules convenience of others.

there. know absolutely need know understand git submodules , incrementally acquire details find need them, understand git submodule command doing you, , why don't have care understanding every little thing on manpage front. @ least, think so.

if i've missed important, i'd glad of (gentle or blunt, don't care) corrections in comments.

git github version-control

No comments:

Post a Comment