Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Aside, I tried to move my ~/Code folder (where all my programming projects and work live) into the macOS iCloud folder so that everything would auto-sync.

But the constant Git churn created a lot of traffic and collisions in that folder. And when I googled it, apparently it's just not a good idea to sync Git projects in iCloud.

I really want to easily sync my folders so that I can just get a new macbook and recreate my environment.

Anyone have any tips?



When moving someone from one macbook to another, i just rsync desktop/documents/downloads over.

I've found migrating ~/library over is problematic even with built in migration assistant, especially if this is their third or later machine being transfered between.

Git is designed with a remote server in mind, just do it that way. Get github or git lab or setup your own remote host.


I’ve had all my personal projects in Dropbox for years without any problems.

I tried the same with Google Drive at work and had lots of issues, but recently it seems to have stabilized.


TL;DR: Move your .git folders out of ~/Code into ~/Git/[reponame]. Use ln -s or plain text .git file[1].

I have my code folders in Dropbox on OSX but I believe my process should work for you. I work in node and have a number of monorepos with nested node_modules folders. I run my idempotent dev-files.command script [2] with or without "--nono" in any monorepo and it handles the entire git aliasing and dropbox folder ignore for node_modules process. I use --nono if I ever need to clear out all of the node_modules and do a fresh pnpm install.

1. https://git-scm.com/docs/gitrepository-layout

2. https://gist.github.com/chiragmehta/a41bd33356b6a2f84075d23d...


Interesting, so it's as easy as putting `gitdir:{path}` in a .git file.

The downside is that git history is pretty useful, so it would suck to not sync it.

But you gave a real solution to the problem.

Edit: I remember now that one problem with iCloud was that doing something like switching Git branches or checking out commits causes a catastrophic sync cascade in the code folder itself.

Maybe Dropbox is better at dealing with that kind of thing in general. But that's pretty annoying for any syncing system to deal with, heh.

I guess the simplest solution is to just get into the habit of pushing every little project to github.


why not put claude code inside a docker environment you control?

you might copy the code working dir in read mode only or whatever idk\


Just ask Claude to recreate your environment.

Not even kidding, it worked for Peter (OP’s article)


Dear Claude:

My brother-in-law just accidentally stepped on my laptop and it literally broke into pieces. Fortunately, I have an extra laptop that I can use instead. Please recreate my environment on the new laptop.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: