-1

I am a software developer and I want to test several versions of my software, with different configuration files and different contents in the database (everything running on Windows).

For example, I have around 10 installations in production with different software versions, configuration and databases. Before updating one of these installations I would like to replicate all this environment in a test machine, update it, test it and, if everything works as expected, update the production environment.

A solution would be having a virtual machine that replicates each installation. Or better, as I would test only one machine at a time, I could have a single virtual machine, with one snapshot for each installation (this would take less disk space and only one Windows license).

As I have some experience with Git and version control systems, I was wondering if it would make any sense to use Git instead of virtual machine snapshots. I would put the binaries, configuration files, database files under version control (one branch for each installation) and switch between Git branches instead of the virtual machine snapshots. Would this make any sense?

The main advantage of Git branches over VM snapshots would be the flexibility at the file level. For example, would be easier to compare differences in a text file present in two branches. Moreover if I had two repositories (bin and db), I could test any database with any set of binaries. Using Git I could use my development machine without using virtualization at all (even if I wouldn't be replicating all installed software of the production machine).

What about keeping the entire Windows file system under Git? I guess this would be much more complicated and there would be problems with installed applications, the Windows registry,...

user2518618
  • 109
  • 2

1 Answers1

2

This doesn't sound like an ideal application for Git. Git isn't oriented toward storing large binary files. You might look at the git-annex project, which uses Git for version control of binary files, but doesn't actually store the binaries in Git.

If you're just talking about dynamically swapping a hierarchy of directories and files you could do this fairly simply by just keeping "gold master" copies of that hierarchy (ideally in a read-only state) and copying them into place with a script. That would be some fairly simple cmd.exe scripting.

Evan Anderson
  • 141,071
  • 19
  • 191
  • 328
  • Didn't know about git-annex, it seems much better that git alone for large binary files. The script may work as well: for each installation I could have a script that copies the correct version of each file into the hierarchy (as a side effect, this script would be a valuable documentation tool) – user2518618 Dec 02 '14 at 16:37