What strategy do you use to sync your code when working from home
Asked Answered
R

24

11

At my work I currently have my development environment inside a Virtual Machine. When I need to do work from home I copy my VM and any databases I need onto a laptop drive sized external USB drive. After about 10 minutes of copying I put the drive in my pocket and head home, copy back the VM and databases onto my personal computer and I'm ready to work. I follow the same steps to take the work back with me.

So if I count the total amount of time I spend waiting around for files to finish copying in order for me to take work home and bring it back again, it comes to around 40 minutes! I do have a VPN connection to my work from home (providing the internet is up at both sites) and a decent internet speed (8mbits down/?up) but I find Remote Desktoping into my work machine laggy enough for me to want to work on my VM directly.

So in looking at what other options I have or how I could improve my existing option I'm interested in what strategy you use or recommend to do work at home and keeping your code/environment in sync.

EDIT: I'd prefer an option where I don't have to commit my changes into version control before I leave work - as I like to make meaningful descriptive comments in my commits, committing would take longer than just copying my VM onto a portable drive! lol Also I'd prefer a solution where my dev environment stays in sync too. Having said that I'm still very interested in your own solutions even if they don't exactly solve my problem as best as I'd like. :)

Rouble answered 12/1, 2009 at 5:58 Comment(7)
Is there a specific reason why you're copying the whole development environment instead of managing the code using revision control? Do you need the data in the databases to be synced between work and home?Pouter
I like having my environments in sync because there are things that are not in source control such as installed apps, app settings, etc. Plus I like to write meaningful comments in my version control commits but would not like to commit each time I want to work from home.Rouble
Version control would be faster, not slower.Harden
Osama, what I mean is for me to go through all my changed files, perform diffs to see what changed and come up with meaningful comments describing my changes each time I want to take work home I think would take longer than just waiting to copy my VM. I realise commiting itself is very quick.Rouble
Sounds like you need a dev laptop.Kellen
Ben, why don't you stop a good 10 minutes early so you have time to write a descriptive comment on your commit then?Mccammon
In your position, I'd probable rethink my version control strategy and massively increase the increase the number of commits made throughout the day while using tagging for a state of the code that is currently considered worthy of a commit.Zilber
L
16

A Distributed / Decentralized Version Control System solution will suit your needs, Git, Bazaar, Mercurial, darcs... you have plenty alternatives.

Learned answered 12/1, 2009 at 6:8 Comment(1)
With a DVCS, you don't have to keep your commits permantly - you can squash a bunch of commits down into a single commit with a good message later on.Spree
B
9

Use a version control software like SVN, SourceOffSite, etc. You just have to check-in all your changes and get the latest changes when you want to sync.

Or you can use Windows Live Sync -> https://sync.live.com/foldersharetolivesync.aspx

Barringer answered 12/1, 2009 at 6:2 Comment(3)
Yeah, we use CVS at work but I don't want to feel forced to commit in whenever I sync work with home and vice-versa. Idealy I'd like to keep my environment in sync too. I might check out that Windows Live Sync. I remember looking at some called Folder Share (I think) at one stage..Rouble
+1 Windows Live Sync has replaced Folder Share. I've been using Folder Share for a while now and it's been a great service that is completely free and works for any number of computers (as far as I know) and you can share your shared folders with others.Falzetta
Okay cool. Are you using (or would you use it) for source code?Rouble
R
6

Hasn't anyone recommended rsync? Use an rsync client to send the diff between files. You can apply these diffs thus bringing your file up-to-date. For the smallest file transfer it's probably the best idea.

Reprobate answered 12/1, 2009 at 8:31 Comment(0)
M
3

I simply use an external portable notebook drive and do all my work on that. All my PCs have it set to the same drive letter. So no copying anything .. I've not attempted to run VMs this way, however, but I don't see any reason it shouldn't simply work.

Mapping answered 12/1, 2009 at 6:43 Comment(2)
Yeah, I've tried running my VMs directly from my notebook drive but unfortunately it was noticably slower - especially when compiling. I am seriously considering buying a fast USB/ESATA memory stick and just running my VMs from there. This is the one I'm looking at kanguru.com/eflash.htmlRouble
Of-course the usb key needs to be faster than my current lappy drive.Rouble
M
3

i use dropbox.

Matthaus answered 12/1, 2009 at 6:47 Comment(2)
You can not be sure who will see your work when using third party service.Aghast
@softly.lt you are correct but also my work is usually open source any ways.Matthaus
A
2

We use Citrix and then I do a remote desktop connection to my PC at work. It is not the fastest solution in the world, but it does eliminate the problem of keeping two or more workstations up-to-date.

Arturo answered 12/1, 2009 at 6:33 Comment(0)
F
2

Here is a solution I use.

  1. Set up a VPN between the office network and the laptop.
  2. Install the VisualSVN Server
  3. Load all projects in the SCC.

When at the office I check out a project, work on it and then check it in. When at home or around the world I connect to the office via VPN, check out my project, do my thing then check it in. Via the VPN connection I can also RDP to my dev boxes and or servers.

Hope this helps. Good luck!

Furcate answered 27/3, 2009 at 15:14 Comment(1)
Oh yeah! I also recently found the SSL VPN quite easy to use.Furcate
H
1

I either connect remotely to the office SVN, or VPN in and remote desktop my dev or desktop machine and carry on working. It's very rare I sync any files, but when I do it's usually with DropBox (although you can't really do that with large files).

Heisler answered 12/1, 2009 at 6:33 Comment(0)
B
1

Write program, that will syncronize all your data through internet, and then shutwodn your computer, so at the end of the day you launch it, and go home, and when you come home all data is already there

Barram answered 12/1, 2009 at 8:9 Comment(0)
M
1

We work with a distributed team, so it is vital everyone has easy and secure code repository access. For this, we use SVN over ssl/https. It works great, reliably and secure.

Meredeth answered 12/1, 2009 at 8:37 Comment(0)
C
1

Depending on the VM software you are using why don't you set up 2 different VM disks, keep your user profile/dev files on one disk and the OS and other programs that change rarely on the other.

This way you can probably get away with only having to copy the larger disk image when you've installed something new and end up only copying a single virtual disk containing your work.

Cordon answered 12/1, 2009 at 11:12 Comment(1)
Ideally I'd prefer a solution where my environment settings are kept in sync too but I like your thinking. I hadn't thought of doing it this way. I think though I'd be too worried I'd forget about something I need in my OS disk (like an installed app, library, etc).Rouble
M
1

Just setup a SVN server at home, forward your router port and get on with your life. rsync is also a good, fast solution. Just remember to use it over SSH.

Mcnally answered 12/1, 2009 at 11:40 Comment(0)
L
0

i connecting to the office net work and download the lates version form svn use the Dev mysql server so i am just like anther computer in the office network

Longspur answered 12/1, 2009 at 5:59 Comment(0)
B
0

I had a similar problem. But fortunately we had a source control server (TFS) configured so I use to work only from the local Virtual Machines stored on my external drive and than check in the required files to the TFS as an when required.

Bradney answered 12/1, 2009 at 6:31 Comment(0)
P
0

you haven't specified the OS and virtualization system, but if you're working VM images that can be mounted, e.g. XEN on linux, then you could mount the image and sync it via rsync.

Prominent answered 12/1, 2009 at 6:42 Comment(1)
Sounds interesting. We run WinXP VMs inside a WinXP/Vista host. We actually do use RSync as part of scheduled task to backup our source onto a linux box at the end of the day and I do appreciate how it only copies the differences, but I'm not sure if I can use it in this scenario?..Rouble
H
0

I imagine that most of the time spent copying involves the database. Is that right? If so, can you not simply connect to your work DB from home using your VPN connection?

You would still copy your source files (or use a source code control system as others have suggested), but this would only take a fraction of the time.

Haemorrhage answered 12/1, 2009 at 7:40 Comment(1)
Actually I don't often copy databases onto the drive unless I've changed the database structure. It's copying the VM virtual disks that take the most time.Rouble
A
0

If all you need is a virtual machine from your work computer, then you could mount a remote catalog (using nfs or smb) where is your virtual machine files store and run that virtual machine from there. This should be faster than using remote desktop.

Aghast answered 12/1, 2009 at 8:24 Comment(0)
T
0

I also use DropBox, and that is key because it is important to keep it simple.

It is generally better if you can have some type of remote desktop ability, because this will allow you to use a standard workstation configuration, and it will allow for consistent connection to network resources (database server, business servers like workflow, etc).

Working offline, in my opinion, is ok for certain tasks, but overall there are obstacles for systems which connect to other resources (unless you plan to move those resources to your home box).

Trichinopoly answered 27/3, 2009 at 15:8 Comment(0)
A
0

It was a problem for me too. So, the company bought me a laptop, and I do my work on it, at home or anywhere else.

Airborne answered 27/3, 2009 at 15:28 Comment(0)
K
0

I have a set up where a folder on one machine is synced to a folder on another machine. any changes to the contents on one machine is also made on the other machine within a minute. So you could sync the top level folder of your work files, and have then sync to your home machine. What I like about this is that syncing is completely transparent. As far as the user experience goes, I'm simply using the file system. No external app to interact with.

I use Live Sync Live Sync from Microsoft to this. You'll need to create a Windows Live ID to use this system. It works for windows and macs.

Katushka answered 27/3, 2009 at 15:39 Comment(0)
S
0

Dropbox and Microsoft's Live Sync are good options that have already been mentioned. My personal favorite is Live Mesh, also from Microsoft. The one great feature that puts it above the other two, in my mind, is the ability to specify which folders get synched on which computers, and where the folders are located. So, for example, I synch my Visual Studio 2005/Projects folder between my work machine and my dev box at home, and I synch Visual Studio 2008/Projects between my side gig VM and my home dev box.

Squarrose answered 29/7, 2009 at 18:13 Comment(0)
M
0

i have a macbook with all my dev software on it; when i go to work, i start it in target firewire mode and plug it into my work macpro with the fast processor, lan connection, big monitor, etc. this way i never have to leave my user folder but i have access to all the software and hardware available at work.

Medievalism answered 31/8, 2009 at 23:32 Comment(0)
P
0

Why don't you just use version control? A DVCS? Find here a tutorial on DVCS for Windows users (very simple) http://codicesoftware.blogspot.com/2010/03/distributed-development-for-windows.html

Proteiform answered 30/3, 2010 at 12:33 Comment(0)
M
0

Some ideas:

  • Use network storage (with SSD cache if speed is a concern), either for your code or to host your VM.
  • Separate data and OS into two virtual disks in your VM.
  • Google drive, Onedrive, Dropbox etc.
  • If you use Visual Studio (Code), try the Live Share extension.
  • Dockerize your environment. Alternatively, I keep a bash script for all the setup I did, so I could almost one-click reinstall my dev environment anywhere.
  • Use a second version control, covering your whole work directory. Commit and push everything before switching environments, then pull and hard reset your commit in another machine.
Midkiff answered 16/3, 2022 at 13:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.