Skip to main content
  1. Posts/

Backing Up GitHub Private Repos to Google Drive

··258 words·2 mins·

☁️ GitHub reliability issues? Use Google Drive as a git remote

With the massive surge in commits from vibe coding, GitHub has experienced outages. An elegant solution: use your own Google Drive (or OneDrive, iCloud, Dropbox) as a private git remote.

🏗️ The “Local-Remote” architecture:

  • Create a bare repository on Google Drive (only metadata, no working files)
  • Work normally on your local SSD
  • Pushes are fast local copies between drives, not network operations

⚠️ The problem with cloud storage and git: Cloud providers aren’t optimized for thousands of micro-files. The fix: force Pack Files that consolidate everything into a single compressed binary.

🔧 Key steps:

  1. git init --bare in your Google Drive folder
  2. Configure gc.auto 0 and repack.writeBitmaps true
  3. Enable “Always keep on device” to prevent “bad object” errors
  4. Connect your local repo: git remote add gdrive "G:\My Drive\..."
  5. git push gdrive --all — just like GitHub

✅ No extra servers. No extra costs. Same git commands you already know.

💡 Explanation in a nutshell
#

Git saves your code history as thousands of tiny files. Google Drive doesn’t handle that well. The fix is to “pack” all those files into one and store that in Drive. This lets you use Google Drive like GitHub, with the exact same commands you already use.

More information at the link 👇

Also published on LinkedIn.
Juan Pedro Bretti Mandarano
Author
Juan Pedro Bretti Mandarano