DEV Community

Omar Elbaga
Omar Elbaga

Posted on

How to keep all dev files in sync when switching computers constantly?

We have about 100 projects and need to switch from office to home computer without feeling like anything is left behind on another computer. What is your best way to keep all dev files and assets for many projects in sync across 2-3 computers? I realize git is a potential solution. I just don't know if it's the true solution for the situation, unless it is? We have so many assets and projects being worked on. I can't imagine having to remember to commit on every project and if there's a commit left behind, etc.

What are your thoughts fellow devs!

Top comments (41)

Collapse
 
omarel profile image
Omar Elbaga

Noting here. We ended up going the git route. There really wasn’t any other better way. I do wish there was an easier way to share all the git ignored files however. But overall git was a good solution. The ignored files are just problematic to share on all the projects with other developers.

Collapse
 
nnnikolov profile image
Nikolay Nikolov

Google Drive Enterprise provede exactly what you want, but it should be pricey. Git is not efficient for non text files and you should always keep in mind to push/pull befor/after switching or use a script. Check the cloud storage providers for best price/value ration and you should be ok.

Collapse
 
omarel profile image
Omar Elbaga • Edited

We have the gsuite. I tried it, but Google Drive constantly threw errors whenever I tried syncing and uploading dev files. Not sure why.

Collapse
 
nnnikolov profile image
Nikolay Nikolov

I am using Drive File Stream with our gsuite, not Drive for Desktop. It works pretty fine. The only limitation is the network connection because it act as a network drive.

Thread Thread
 
omarel profile image
Omar Elbaga

Same here. I'm not sure why I kept getting errors. It would skip certain folders and I couldn't figure out why. Mac would just throw an error that certain folders couldnt be uploaded.

Thread Thread
 
nnnikolov profile image
Nikolay Nikolov

That's the difference. I am only using it on Windows 10. Maybe there is something specific on Mac.

Thread Thread
 
omarel profile image
Omar Elbaga

Ah maybe.

Collapse
 
nirzaf profile image
Fazrin

Use Yandex Disk, It is damn smooth in Sycing between computers and even with mobiles, Trust me you won't be disappointed

Collapse
 
digizeph profile image
Mingwei Zhang

I use resilio sync to sync my dev folders for all my machines. Sometimes it gets crazy when I’m doing compilation tasks, like thousands of temporary files generated and deleted. In general, I just leave it running and never need to think I about synchronize folders. It also works on all platforms, and syncs with my Synology nas.

I started using it since it was called “bt sync” back then, and it has been working well enough that I have never thought about changing to other alternatives.

Collapse
 
omarel profile image
Omar Elbaga

Yeah I found these cloud sync solutions. What you're going through seems to be a common problem of these online sync solutions with dev files. I found some hacks of storing node_modules outside the sync directories, but it's kind of another hassle to deal with. I'm still testing. It would be great if a solution existed just for development. It would definitely take off.

Collapse
 
digizeph profile image
Mingwei Zhang

You can specify resilio to not sync certain folders, matched by regex I believe.

Collapse
 
matoval profile image
matoval

You could get an nas storage device that connects to your home network. I don't have one yet but I'm planning on getting one. Synology is the brand I'm looking at. SyntaxFM had an episode on it. syntax.fm/show/220/the-synology-sh...

Collapse
 
gwutama profile image
Galuh Utama • Edited

I wouldn't complicate things with synchronizing hundreds or even thousands of files over sync solutions like dropbox or google drive. In the company I'm working for, using these cloud drives to store files are forbidden (mostly because of GDPR issues). And sometimes synchronizing a lot of small files can take a long time and is less reliable than git.

So my solutions right now are:

  1. Laptops instead of work PCs. Bring the laptops home when you need to work from home.
  2. Remote PC solution with TeamViewer, VNC, Remote Desktop, etc to the office PC from home. Assuming that your internet connection from home is good.
Collapse
 
omarel profile image
Omar Elbaga

Hmm. I definitely appreciate your point of view. We're thinking of laptops, but you know the Team Viewer has always been kind of a hassle and it's not very productive. It's very slow and has other problems. It's good to do a quick thing, but if you really have to actually work through Team Viewer I would completely forget about that as an option.

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

How about rsync and external hard disk containing shell scripts?

Very useful when I wanted to include gitignored files as well as excluding node_modules.

Collapse
 
omarel profile image
Omar Elbaga

I'm not familiar with rsync. Worth checking out.

Collapse
 
blake profile image
Blake K

Have you considered developing on a remote environment/machine (via SSH) instead of your local machines? Visual Studio Code has an amazing plugin for this.

Collapse
 
phambatrungthanh profile image
Phạm Bá Trung Thành

For me, it's a combination of private VPS that I can SSH to and VS Code Remote Development.

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

How is it different from USB stick / external hard disk?

Collapse
 
omarel profile image
Omar Elbaga

Yeah would love to hear more about that option! @pacharapol I think it's different because you would leave the VPS connected to a main computer and I assume you could leave it in place and then any other computer could use that VPS remotely as a hard drive "in the cloud" by logging into it.

Collapse
 
phambatrungthanh profile image
Phạm Bá Trung Thành

Well, aside from keeping all your code in one place, you can have your git histories, commits without syncing, and you can run build jobs, run docker containers, deploy codes, forwarding ports to preview code from your local computer. Pretty much anything you can do on your local computer, you can do it on the remote cloud.

Collapse
 
ashutosh049 profile image
ashutosh049

Exactly! Foremost option is to go for some sort of versioning system(gitlab, github, bitbucket). Another option would be to use/install git over some remote machine and keep your code there. By this you need not keep/commit any local copy of file, everything would be on your server. You can just login to your machine and use it. Have not tried yet lol

Would love to hear other option.

Collapse
 
omarel profile image
Omar Elbaga

It seems like git could be a solution, but theres 2 problems with using GIt for this kind of thing. 1 is that with git we typically hide many folders whereas with syncing computers we need all files to match. 2. It's not really a real time sync. so we would need to keep committing constantly for little things done. It seems like git with some cloud syncing option is good, I'm looking into sync.com and dropbox syncing but still running into problems keeping these cloud folders loaded properly on local Apache servers

Collapse
 
nirzaf profile image
Fazrin

Use Yandex Disk, It is damn smooth in Sycing between computers and even with mobiles, Trust me you won't be disappointed, it has a free limitation upto 10GB but it is damn cheap for pro version as well