Hey everyone, I’m wondering if it’s okay to keep my Git repos in my Google Drive folder. I use two computers for work and want to sync everything easily.
Basically, I set up Git repos in my Drive folder on one computer, and Drive syncs them to my other machine. This way, I can keep big files (like datasets) synced through Drive while using Git for my code.
It’s handy because:
- I can access everything on both computers
- If I forget to push changes, they’re still available on the other computer
But I’ve heard this might cause problems. Like:
- Conflicts in the .git folder if both computers sync at once
- Incomplete syncs messing up the repo
Since I’m the only one using these repos and I don’t often work on both computers at the same time, will I run into these issues? Or are these problems mainly for teams?
I’m also looking at tools like RepoSync to help manage this setup. Has anyone tried something similar?
Thanks for any advice!
i’ve used drive for git before. not ideal but can work if ur careful. main issue is sync conflicts in .git folder. try excluding it with .gitignore.
also, make sure to commit/push before switching computers. might wanna look into git-lfs for big files.
personally, i switched to github + drive combo. works better for me.
I’ve actually tried a similar setup before, and while it can work, there are some potential pitfalls to be aware of.
In my experience, the biggest issue was occasional sync conflicts, especially with the .git folder. Even though I wasn’t usually working on both machines simultaneously, Google Drive’s background syncing sometimes caused problems.
One workaround I found helpful was to use a .gitignore file to exclude the .git folder from syncing. This prevented most conflicts, but it also meant I had to manually push/pull changes more often.
Ultimately, I switched to using a private Git repository host like GitLab or GitHub for code, while keeping large datasets in Google Drive. This gave me the best of both worlds - version control for code and easy syncing for big files.
If you do stick with the Google Drive method, I’d recommend being extra cautious about always committing and pushing changes before switching machines. Also, consider setting up automated backups just in case something goes wrong with the sync.
I’ve encountered similar challenges with Git repos in cloud storage. While it’s tempting for convenience, there are risks to consider. The .git folder is particularly sensitive to sync conflicts, which can corrupt your repository. Even if you’re the sole user, Drive’s background sync might cause issues.
A more robust approach is using a dedicated Git hosting service like GitHub or GitLab for your code, while keeping large files in Drive. This separates version control from file syncing, reducing potential conflicts. For your use case, you could use Git LFS (Large File Storage) to handle those big datasets within your repo.
If you’re set on using Drive, consider creating a script to regularly backup your repos to a separate location. This provides a safety net in case of sync problems. Remember, version control is crucial - always commit and push before switching devices to minimize risks.