0
I'm transitioning my personal projects from using subversion (svn) to GIT. In subversion, I've used a shared SVN working directory on several hosts (despite people telling me it wouldn't work), and it's proven to work nicely for me. It's important to point out this this is a single user solution, and I'm the only person making changes so I'm not running SVN commits on multiple boxes at the same time. In short, I'm willing to live with some limitations (if necessary) to simplify the overall management of my personal projects.
To understand why I'm looking to do this consider my configuration (below). I have a couple beefy machines each running several VMs. I have several large disks on "host1" and have file shares that other hosts (in the local LAN) access.
host1 (share \\host1\share)
+vm1 (access SVN working dir \\host1\share\svnproj1, and svnproj2)
+vm2 (access SVN working dir \\host1\share\svnproj1)
+vm3 (access SVN working dir \\host1\share\svnproj1)
host2
+vm4 (access SVN working dir \\host1\share\svnproj1)
+vm5 (access SVN working dir \\host1\share\svnproj1)
laptop (access SVN working dir \\host1\share\svnproj1)
But also have a svn checkout at c:\svnproj1
All of the OSs are Win7x64 or Win8.1x64. I'm currently using Tortoise SVN 1.8.2, and subversion 1.8.3 (on ALL of the hosts).
This approach lets me access the server's file share (\host1\share) from any host. In some cases, my svn repos are many years old and over 2 GIG having separate "SVN working areas" in each VM makes my VMs larger and complicates my VM Snapshots, and backups.
I also do not have to commit files until I'm taking my laptop for a business meeting. I work from home so this is not frequent. When I return from a business meeting or trip, I commit my changes on my laptop and update run svn update on any one of the 5 VMs and the files are updated for all 5 VMs. For me this is simple enough and has worked well.
So now I'm wondering if this same approach can work using GIT. Everything I've read says you can't (or shouldn't do this).
Here are the questions I have that will help me understand if this is even technically possible (NOTE: I'm already experimenting with this approach).
(Q) Does GIT store information on a host outside of the GIT repo (.git dir) and require that information in order to properly manage the git repo. If it does, then having several machines configured identically with that information is not feasible.
(Q) Does GIT create temporary files within the GIT working area? If it does, would that temp information screw up another copy of git running on another machine? If so, then again this approach is not feasible.
(Q) Does GIT have the same issue as Subersion in that all of the clients using a given repo need to be of the same version?
(Q) Does this approach fail if another OS is introduced (Linux, Apple OSX)?
(Q) If used a cloud storage provider like Dropbox, or SpiderOak does this solution still work?
(Q) Are there other questions or issues that I might run into when using GIT that I would not see when using SVN.
Again, it is important to note is that this solution only needs to work for me, there will never be multiple people making changes to the GIT repository, and I can live with some limitations if it simplifies the overall management of the VMs.
This article http://www.sitepoint.com/how-to-use-dropbox-with-svn-or-git-for-cloud-source-control-management/ did a nice job of explaining how to use GIT in the traditional way. For me the Dropbox solution is equivalent to the local LAN file share.
Just FYI. Through trial and error I've abandoned the attempt to share a single .git repo on a shared drive. One of the problems I ran into was
git status
taking an inordinately long time to complete (on a repo that had thousands of files in it). I don't know that I ever tracked it down but when I asked others, several people said or implied ...your using git in a way that it wasn't designed, so you are basically on your own
to figure this out. I never did figure it out. It may have been a problem with windows git version and windows file sharing for all I know. – PatS – 2020-02-22T00:55:29.287