๐Ÿ—‚๏ธ Cloud brain + local mount + git = the corruption nobody warns you about
๐—œ ๐˜„๐—ฟ๐—ผ๐˜๐—ฒ ๐˜๐—ต๐—ฒ ๐˜€๐—ฐ๐—ฟ๐—ถ๐—ฝ๐˜ ๐˜๐—ต๐—ฎ๐˜ ๐˜„๐—ฎ๐˜€ ๐˜€๐˜‚๐—ฝ๐—ฝ๐—ผ๐˜€๐—ฒ๐—ฑ ๐˜๐—ผ ๐—ฝ๐—ฟ๐—ฒ๐˜ƒ๐—ฒ๐—ป๐˜ ๐˜๐—ต๐—ถ๐˜€. ๐—œ๐˜ ๐—ฑ๐—ฒ๐—น๐—ฒ๐˜๐—ฒ๐—ฑ ๐Ÿฎ๐Ÿต ๐—ฟ๐—ฒ๐—ฎ๐—น ๐—ณ๐—ถ๐—น๐—ฒ๐˜€ ๐—ฎ๐—ป๐—ฑ ๐—ฐ๐—ผ๐˜€๐˜ ๐—บ๐—ฒ ๐˜๐—ต๐—ฒ ๐—ฟ๐—ฒ๐—ฝ๐—ผ.
The setup is the one most of us land on, because every step of it is sensible. Your Company Brain lives in Google Drive so it syncs everywhere. The desktop app makes it a normal folder. Your code ends up in there too, so the brain and the work sit together. Then you work from two machines and point AI agents at all of it.
Every choice is fine. Together they put ๐—ฎ ๐—ฑ๐—ฎ๐˜๐—ฎ๐—ฏ๐—ฎ๐˜€๐—ฒ ๐—ถ๐—ป๐˜€๐—ถ๐—ฑ๐—ฒ ๐—ฎ ๐—ณ๐—ถ๐—น๐—ฒ ๐˜€๐˜†๐—ป๐—ฐ๐—ฒ๐—ฟ.
Here is the collision. Your git folder is a database. Google Drive does not merge conflicts, it renames them, adding a " 2" or a " (1)". It does that everywhere, including inside the git folder. Git never puts a space in its own internal filenames, so the moment Drive renames one, git cannot read its own history.
It never announces itself as a sync problem. It shows up as git having amnesia: "bad sha1 file", "badRefName", a missing object, or a push that just gets refused. Nothing hints that sync did it.
๐—ก๐—ผ๐˜„ ๐˜๐—ต๐—ฒ ๐—ฝ๐—ฎ๐—ฟ๐˜ ๐˜๐—ต๐—ฎ๐˜ ๐—ฐ๐—ผ๐˜€๐˜ ๐—บ๐—ฒ ๐˜๐—ต๐—ฒ ๐—ฟ๐—ฒ๐—ฝ๐—ผ๐˜€๐—ถ๐˜๐—ผ๐—ฟ๐˜†.
The obvious fix is a script that deletes every odd-looking file inside the git folder. I wrote that script. I was proud of it. It ran on every single commit.
What I did not know is that Drive sometimes renames the ORIGINAL rather than adding a copy beside it. So those "junk" files are sometimes your only copy of a real git object.
My clever cleanup deleted 29 of them. The repo could no longer rebuild its own history. Re-clone. The work survived only because it had been pushed.
๐—ง๐—ต๐—ฒ ๐—ฐ๐—ผ๐—ฟ๐—ฟ๐—ฒ๐—ฐ๐˜ ๐—ฟ๐˜‚๐—น๐—ฒ ๐—ถ๐˜€ ๐—ผ๐—ป๐—ฒ ๐—น๐—ถ๐—ป๐—ฒ, ๐—ฎ๐—ป๐—ฑ ๐—ถ๐˜ ๐—ถ๐˜€ ๐˜๐—ต๐—ฒ ๐—ผ๐—ฝ๐—ฝ๐—ผ๐˜€๐—ถ๐˜๐—ฒ ๐—ผ๐—ณ ๐˜„๐—ต๐—ฎ๐˜ ๐˜‚๐˜€๐˜‚๐—ฎ๐—น๐—น๐˜† ๐—ด๐—ฒ๐˜๐˜€ ๐˜„๐—ฟ๐—ถ๐˜๐˜๐—ฒ๐—ป:
โ€ข Suffixed file exists, original is MISSING, so ๐—ฟ๐—ฒ๐˜€๐˜๐—ผ๐—ฟ๐—ฒ ๐—ถ๐˜. Drive renamed your original.
โ€ข Suffixed file exists, original is there, so delete the duplicate. The original is fine.
Nothing inside the git folder gets deleted unless a correctly named file survives next to it.
And the habit that matters more than any script:
๐—ง๐—ต๐—ฒ ๐—ฟ๐—ฒ๐—บ๐—ผ๐˜๐—ฒ ๐—ถ๐˜€ ๐˜๐—ต๐—ฒ ๐˜€๐—ผ๐˜‚๐—ฟ๐—ฐ๐—ฒ ๐—ผ๐—ณ ๐˜๐—ฟ๐˜‚๐˜๐—ต. ๐—ง๐—ต๐—ฒ ๐˜€๐˜†๐—ป๐—ฐ๐—ฒ๐—ฑ ๐—ณ๐—ผ๐—น๐—ฑ๐—ฒ๐—ฟ ๐—ถ๐˜€ ๐—ฎ ๐—ฟ๐—ฒ๐—ฝ๐—น๐—ฎ๐—ฐ๐—ฒ๐—ฎ๐—ฏ๐—น๐—ฒ ๐˜ƒ๐—ถ๐—ฒ๐˜„ ๐—ผ๐—ณ ๐—ถ๐˜. ๐—ก๐—ผ๐˜๐—ต๐—ถ๐—ป๐—ด ๐—ถ๐—ฟ๐—ฟ๐—ฒ๐—ฝ๐—น๐—ฎ๐—ฐ๐—ฒ๐—ฎ๐—ฏ๐—น๐—ฒ ๐—ฒ๐˜ƒ๐—ฒ๐—ฟ ๐—น๐—ถ๐˜ƒ๐—ฒ๐˜€ ๐—ผ๐—ป๐—น๐˜† ๐—ถ๐—ป ๐˜๐—ต๐—ฎ๐˜ ๐—ณ๐—ผ๐—น๐—ฑ๐—ฒ๐—ฟ.
Hold that and corruption costs you thirty seconds. Break it and corruption costs you work. Also, never run git gc, git prune or git repack on a repo you think is damaged. Those turn a recoverable repository into a lost one.
So I packaged the whole fix and wrote it up, so nobody else has to learn it the way I did.
๐—ง๐—ต๐—ฒ ๐—ด๐˜‚๐—ถ๐—ฑ๐—ฒ ๐—ต๐—ฎ๐˜€ ๐—ฎ ๐—ฑ๐—ผ๐˜„๐—ป๐—น๐—ผ๐—ฎ๐—ฑ ๐—ฏ๐˜‚๐˜๐˜๐—ผ๐—ป. It gives you one folder, git-in-drive, containing:
โ€ข ๐—ง๐—ต๐—ฒ ๐˜€๐—ธ๐—ถ๐—น๐—น ๐—ถ๐˜๐˜€๐—ฒ๐—น๐—ณ. Drop it in your agent's skills folder, say "use git-in-drive on this repo", and it runs the six-step install and reports back on each step.
โ€ข ๐—” ๐—ณ๐—ถ๐—น๐—น-๐—ถ๐—ป-๐˜๐—ต๐—ฒ-๐—ฏ๐—น๐—ฎ๐—ป๐—ธ๐˜€ ๐—ฝ๐—ฟ๐—ผ๐—บ๐—ฝ๐˜, for any tool that cannot load skills. Three blanks, paste, done.
โ€ข ๐—ง๐—ต๐—ฒ ๐˜„๐—ฟ๐—ถ๐˜๐˜๐—ฒ๐—ป ๐—ฆ๐—ข๐—ฃ, ready to drop into your own Company Brain.
โ€ข ๐—ง๐—ต๐—ฟ๐—ฒ๐—ฒ ๐˜€๐—ฐ๐—ฟ๐—ถ๐—ฝ๐˜๐˜€: the cleaner that restores instead of deleting, a session check that tells you whether your folder actually matches your remote, and a safe reset for when it does not.
โ€ข ๐—™๐—ผ๐˜‚๐—ฟ ๐—ด๐—ถ๐˜ ๐—ต๐—ผ๐—ผ๐—ธ๐˜€. These are the ones that matter, because git runs hooks no matter which tool started the command. They cover Claude Code, Codex, Cursor, your IDE, and you.
Plain bash and git. Nothing to install, no dependencies. The same fix works on OneDrive, Dropbox and Box, because they all resolve conflicts by renaming.
๐——๐—ผ ๐˜๐—ต๐—ถ๐˜€ ๐—ผ๐—ป๐—ฒ ๐˜๐—ต๐—ถ๐—ป๐—ด ๐—ฒ๐˜ƒ๐—ฒ๐—ป ๐—ถ๐—ณ ๐˜†๐—ผ๐˜‚ ๐—ฟ๐—ฒ๐—ฎ๐—ฑ ๐—ป๐—ผ๐˜๐—ต๐—ถ๐—ป๐—ด ๐—ฒ๐—น๐˜€๐—ฒ. The guide has a five-line test that renames a real git object and then checks that your guardrail puts it back. Run it. If your cleanup deletes that file instead of restoring it, you are running the version that loses repositories, and you would much rather learn that on a Tuesday than during an incident.
About three minutes per repo, and then it is handled on every machine.
Grab the full guide and full download package here: https://os.agenticsociety.com/tutorials/google-drive-drift
If your repo lives in Drive, go run the test and tell me what it said. I am curious how many of you are one sync away from a bad morning.
2
2 comments
Roman Bediner
2
๐Ÿ—‚๏ธ Cloud brain + local mount + git = the corruption nobody warns you about
Agentic Society
skool.com/agentic-society
We are owners & operators making businesses Agentic. The Mastermind community, AI Agent Academy, and Agentic OS โ€” built together. Austin, TX & beyond.
Leaderboard (30-day)
Powered by