Is it problematic to manage Git repositories inside Google Drive for personal use across two computers?

I currently use Git repositories stored in my Google Drive folder to sync my work between a personal computer and a work laptop. Here’s how I set it up: 1. I create Git repositories in a Google Drive folder on one machine. 2. Google Drive syncs those repositories, including the .git directory, to my other computer. 3. This setup allows me to keep large files like datasets synchronized via Google Drive while managing code and versioning with Git. This approach benefits me because: - I can access both the repository and large files on either machine. - Even if I forget to push my changes, my latest edits are still accessible on the other computer through Google Drive. That said, I’ve heard using Git with cloud-synced folders like Google Drive might lead to sync issues since Git and Drive manage files differently. Some potential problems I’ve read about include: - Conflicts or corruption in the .git folder if both devices sync simultaneously. - Incomplete syncs that could leave the repository in an unstable state. Given that I’m the sole contributor to these repositories and usually don’t make changes on both devices at the same time, could these issues disrupt my workflow? Or are these concerns primarily for scenarios with multiple users collaborating on the same Git repository? Update: Google Drive helps me manage sizable files that I either cannot upload to GitHub or prefer not to, due to their size or the lengthy process of pushing and pulling repeatedly between devices. Moreover, if I forget to push changes, I can still access the repository in its latest state on the other machine. This combination of Google Drive for syncing and Git for version control gives me the flexibility to manage both substantial files and a well-organized history of commits. I’ve also discovered tools like DriveGit and would like to know if anyone has experience with it or similar solutions.

Your workflow can actually work reasonably well for single-user scenarios, but there are some practical considerations you should be aware of. I’ve been using a similar setup for smaller projects where I need to sync both code and data files that don’t belong in traditional Git hosting. The key is being disciplined about your workflow habits. Always ensure Google Drive has finished syncing before starting work on the other machine - you can check the sync status in the Drive client. I also make it a rule to commit and wait for the sync icon to show completion before switching devices. This prevents most of the timing issues that cause problems. One thing that helped me was creating a simple batch script that checks if any .git files are currently being synced before I start working. Google Drive shows sync status through file icons, so you can spot when internal Git files are still uploading. The corruption risks are real but manageable with good habits. Just remember that unlike proper Git remotes, Google Drive doesn’t understand Git’s atomic operations, so interrupted syncs can leave things in weird states.

I tried this exact setup for about six months and eventually ran into problems that made me switch approaches. The main issue wasn’t corruption as much as timing conflicts with the .git directory. Google Drive would sometimes sync partial states of the repository, especially when switching between machines quickly. I’d occasionally find myself with a repository that Git couldn’t recognize properly because some internal files were still uploading in the background. The real breaking point came when I made a quick commit on my laptop, closed it, then opened my desktop before the sync completed fully. Git threw errors about refs that didn’t exist yet. What worked better for me was keeping large datasets in Google Drive but moving the actual Git repositories to proper remote hosting like GitHub or GitLab, even private repos. For files too large for GitHub, I use Git LFS which handles big files more reliably than hoping cloud sync timing works out. The peace of mind knowing my repository integrity is protected outweighs the convenience of having everything in one cloud folder.

honestly ive been doing something similar for like 2 years now and its mostly fine if your careful. the main thing is dont work on both machines at the same time - sounds like you already know this tho. i had one bad experience where google drive got confused during a sync and messed up some refs but i was able to fix it with git fsck. for what its worth, i think the horror stories are mostly from people who werent paying attention to sync status or tried to work simultaneously on multiple devices.