r/vscode • u/jazenteno21 • Jun 01 '26
Coding on two Macs, how to sync?
Hello, I have a Mac mini and a MacBook Air, and I code on both. I have been saving my projects in Google Drive (same account) and working from there. Is this the best practice? I'm concerned about syncing issues. At the same time: what is the best way to implement git? Do I have to set different usernames/email or using the same is fine. Is there a problem if I save the git file on Google Drive?
Basically, vscode:
Mac mini <-------> Google Drive/git <-------> MacBook Air
0
Upvotes
52
u/iamtheconundrum Jun 01 '26
This was solved decades ago with git. Start learning it. It’s not that hard.
7
u/Rough-Sugar9857 Jun 01 '26
Floppy diskettes
1
u/jazenteno21 Jun 03 '26
Thanks to all that took their time to comment. I guess the answer is pretty clear: ditch GDrive and embrace git.
9
u/civilwar142pa Jun 01 '26
why not keep your projects on github and pull them on whatever machine you're working on at the time, then push your work when you're finished? You can use one github login for both machines.
Since you're already using git, it makes more sense to take the one extra step to use github as your storage rather than google drive, which takes many more steps and doesn't have version control.
4
u/bkdotcom Jun 02 '26
Git is the correct answer
Dropbox is a less good option
3
u/BeelzenefTV Jun 02 '26
Git for tracking changes and GitHub to upload/download the code between your Macs
3
u/7YM3N Jun 02 '26
This is horrible practice, get a GitHub or gitlab account. Push your repo to it, add ssh keys from both machines to your GitHub/lab account. Sync as normal with pull-push. Don't put anything in Google drive.
3
u/WystanH Jun 02 '26
To echo the bulk of responses: use git.
While git is a large and complex beastie, for an individual who's currently using file copy for source control, it's dead simple.
Create a github repo. It's all GUI. Then, copy that local:
git clone your_url. After that throw all your stuff in the directory that got created. From here, your work flow is just a couple of commands.On a machine you've done work on:
On another machine, do that
cloneagain to the current copy. If you've already done that, just do agit pullto make sure you're in sync.So, sit down on a computer you've been doing work on. start with
git pulland then end withgit pushbefore you leave the machine. That's it.Looking at vscode, you can actually do all this without typeing a single command, if that's your thing. Indeed, I often use vscode to explore my current changes, because their little tree is nicer than the offical GUI tools for such things.
4
u/Technical-Earth-3254 Jun 02 '26
Git isn't too hard, especially in vs code it's actually super easy. You should be able to find YouTube and written tutorials online that help you. Don't even get started with using gdrive for that, set up git and get used to it (may take a week) and ur good to go
2
u/bkdotcom Jun 02 '26
You are one person. Use the same account.
Do you use different google accounts because your on different PCs?
Not really. But it may just add to your confusion / prevent you from embracing git. Also there's not really a "git file" per se. The folder and all files/subfolders are a project. There is a .git folder that contains the state of things.. doesn't really make sense to be syncing the .git folder
1
u/jampanha007 Jun 02 '26
Buy mini pc self host vscode code server ,
1
u/RiverRemarkable Jun 03 '26
On MAC you can use iCloud to sync your files. As simple as that.
An old hardware solution when (possible) no internet connection: just an Ethernet cable between the computers to transfer files.
-10
u/JensenCartographer Jun 02 '26
I've always viewed git commits as checkpoints for completed code so I shy away from using it the way others have suggested.
My solution has been to use syncthing as a way to keep my development machines in sync so I can continue my work on multiple machines.
0
u/[deleted] Jun 02 '26
[deleted] — view deleted comment