Michael L Torrie wrote: > Michael L Torrie wrote: > >> Andrew McNabb wrote: >> >>> Michael, it sounds like you want Git submodules. They're a relatively >>> new feature. As an svn user, you're probably familiar with >>> svn:externals. Submodules is basically the same idea. >>> >>> <snipped lots of mcnabb wisdom> >>> >> So this would sort of help me with my question about the >> pseudo-centralized repository, right?. For example, I have lots of >> little projects, and even documents, scattered over my home directory >> that I want to keep in git. They are often organized by some sort of >> categorization system (subtrees in svn). With svn, of course, I can keep >> one central repository that I can back up. How can I emulate part of >> this with git? IE I don't want to go to my backup computer and have to >> clone tons of little projects separately. Of course with git I'd have >> to remember to push my projects into this "master" git supermodule, >> right? I think this could work. Any thoughts? >> > > Replying to my own post here... Actually with git I can organize it > like this, right: > > - lots of independent projects > - one git supermodule that includes them all as submodules > - clone my backup git repository from this supermodule which will pull > in the subs automatically. > > Correct? > yes, as long as your backups system can access them (ie, ssh keys to each submodule) > What happens if I move the physical location of a submodule to another > folder? Do I have to redo the submodule in the "master" repository? > When pulling over, say ssh, can the git supermodule pull the submodules > automatically? Sorry for the potentially dumb questions. > > Michael > > in your supermodule you have a .gitmodules file that you can manually edit to change path, url, and name.
so say you have submodule "a" path a url ssh://hostname/gitrepos/a you can in your supermodule change the path, ie, git mv a b and then manually edit your .gitmodules file you can also move the physical location of your hostname/gitrepos/a to say hostname/gitrepos/b, and then update the .gitmodules file to point to the new url. I find that with submodules it is most useful to have them all be bare repositories, so that when you push to it, you can pull from that repo outside of the supermodule without having to run git checkout -f from within the submodule. -- Jon Wilson -------------------- BYU Unix Users Group http://uug.byu.edu/ The opinions expressed in this message are the responsibility of their author. They are not endorsed by BYU, the BYU CS Department or BYU-UUG. ___________________________________________________________________ List Info: http://uug.byu.edu/mailman/listinfo/uug-list
