I just took over a web development position for a company that manages a lot of different sites. There are a couple different site "designs" and for each design, there's a couple cookie-cutter type versions of the same thing. They're different sites, but the framework is so close to the same, that since only the content and some styling changes, the previous guy had just been copy-pasting these to the specific hosts.
So my question is whether or not Git is the right thing for this? I've used git a little bit on my own side-projects, but we're talking hundreds of sites (about 10 per design) for this job. Would a bunch of branches be a good way to go? Mainly, what I want to be able to do is quickly and easily update the common files. The previous guy was just using a perl script to transfer things over to "update" the sites when we made a global change. Seems like it would be much more fool-proof and controlled (version controlled) with git.
Subversion was another thought of mine, but I don't have the access to install that on all the servers. Most files are transferred via ftp, but with some finagling, I could probably get some ssh (I'd probably set it up with fuse for sshfs) going as well.
Any thoughts? Or, if I'm going about this completely wrong, let me know, also. I've never dealt with anything this size (i.e. lots of sites) before, and it just seems really messy. I know there's a better way to do it!
Thanks!
git submodules remain a good way to keep track of other repos, including:
That means that each of your website is a "parent" repo which includes the two submodules mentioned above.
The trick is, especially for the submodule representing common file, is to declare it in a website as "following the latest commits of a branch".
git submodule add -b master common url/to/common/files/repo
That way, each time you have to work on one of those website repo, all you need to do first is a:
git submodule update --remote
And you are sure to work with the latest up-to-date common files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With