Video series · 19 parts

Syncing Projects with Google Drive

Building a CLI that syncs code projects to Google Drive: OAuth, the Drive API, concurrent uploads, a custom .gitignore parser and an incremental sync algorithm.

  1. Part 1
    Sync code with Google Drive - Part 1 (Google Cloud Console, OAUTH) thumbnail
    YouTube

    Sync code with Google Drive - Part 1 (Google Cloud Console, OAUTH)

    I start building a custom Google Drive syncer in Go because GitHub alone did not save me when my hard drive corrupted and I lost local changes that were never pushed.

    Watch →
  2. Part 2
    Syncing projects with Google Drive - Part 2 (Config Files and Drive API) thumbnail
    YouTube

    Syncing projects with Google Drive - Part 2 (Config Files and Drive API)

    I refactor the Google Drive syncer so the OAuth flow and Drive service setup live in a Drive struct with a Connect method instead of bloating main, then add a JSON config file that drives what gets synced.

    Watch →
  3. Part 3
    Syncing projects with Google Drive - Part 3 (Upload to Drive) thumbnail
    YouTube

    Syncing projects with Google Drive - Part 3 (Upload to Drive)

    I implement the upload half of my Drive Syncer by creating Google Drive folders and pushing every local file inside a configured project folder up to Drive.

    Watch →
  4. Part 4
    Syncing projects with Google Drive - Part 4 (Handling Subfolders and Duplicates) thumbnail
    YouTube

    Syncing projects with Google Drive - Part 4 (Handling Subfolders and Duplicates)

    I show how I make DriveSyncer handle duplicate project uploads and nested subfolders in Google Drive by deleting and re-uploading the previous project folder and creating subfolders with the correct parent IDs.

    Watch →
  5. Part 5
    Syncing projects with Google Drive - Part 5 (Reading .gitignore files) thumbnail
    YouTube

    Syncing projects with Google Drive - Part 5 (Reading .gitignore files)

    I add .gitignore-aware uploads to my Google Drive syncer so each project's ignored files and my global ignore list are skipped automatically.

    Watch →
  6. Part 6
    Syncing projects with Google Drive - Part 6 (Refreshing OAuth Tokens) thumbnail
    YouTube

    Syncing projects with Google Drive - Part 6 (Refreshing OAuth Tokens)

    I wire up automatic OAuth token refresh for the Google Drive syncer so I never have to manually re-authorize access again.

    Watch →
  7. Part 7
    Syncing projects with Google Drive - Part 7 (Reorganizing Codebase) thumbnail
    YouTube

    Syncing projects with Google Drive - Part 7 (Reorganizing Codebase)

    I reorganize my Google Drive syncer's Go codebase into proper packages before building the CLI, because maintenance work matters as much as shipping features.

    Watch →
  8. Part 8
    Syncing projects with Google Drive - Part 8 (Set up CLI cmds) thumbnail
    YouTube

    Syncing projects with Google Drive - Part 8 (Set up CLI cmds)

    I set up a working Go CLI with Cobra for my Google Drive sync project, moving the folder-upload logic behind a sync command.

    Watch →
  9. Part 9
    Syncing projects with Google Drive - Part 9 (Concurrent uploads and progress bars) thumbnail
    YouTube

    Syncing projects with Google Drive - Part 9 (Concurrent uploads and progress bars)

    I make DriveSyncer upload multiple project folders concurrently and add per-folder terminal progress bars. I move each folder upload into a goroutine guarded by a WaitGroup, stream UploadProgress pointers through a…

    Watch →
  10. Part 10
    Syncing projects with Google Drive - Part 10 (New sync algorithm) thumbnail
    YouTube

    Syncing projects with Google Drive - Part 10 (New sync algorithm)

    I fix the upload progress bars so they reach 100% and start building a more efficient Google Drive sync algorithm that skips unchanged files instead of deleting and re-uploading the whole project folder.

    Watch →
  11. Part 11
    Syncing projects with Google Drive - Part 11 (Mapping local to remote projects) thumbnail
    YouTube

    Syncing projects with Google Drive - Part 11 (Mapping local to remote projects)

    I build a queue-driven project-tree walker that maps every local file and folder to its Google Drive counterpart so the syncer can tell what changed.

    Watch →
  12. Part 12
    Syncing projects with Google Drive - Part 12 (Ignoring unchanged files) thumbnail
    YouTube

    Syncing projects with Google Drive - Part 12 (Ignoring unchanged files)

    I show how to make the Drive syncer skip unchanged files by adding a shouldUpload method that compares local and remote checksums, and I fix a major subfolder bug by keying subfolders on their full paths instead of…

    Watch →
  13. Part 13
    Syncing projects with Google Drive - Part 13 (Overwriting files) thumbnail
    YouTube

    Syncing projects with Google Drive - Part 13 (Overwriting files)

    I show how to overwrite existing Google Drive files during a project sync instead of uploading duplicate copies.

    Watch →
  14. Part 14
    Syncing projects with Google Drive - Part 14 (Deleting ghost files) thumbnail
    YouTube

    Syncing projects with Google Drive - Part 14 (Deleting ghost files)

    I add ghost-file deletion to my Google Drive syncer so files removed locally are also moved to Drive trash instead of lingering remotely.

    Watch →
  15. Part 15
    Syncing projects with Google Drive - Part 15 (Bug hunting) thumbnail
    YouTube

    Syncing projects with Google Drive - Part 15 (Bug hunting)

    I hunt down and fix three small bugs in my Google Drive sync project before building further: the project-exists query was matching any folder in the parent instead of checking the folder name, the project-tree walker…

    Watch →
  16. Part 16
    Syncing projects with Google Drive - Part 16 (Custom gitignore parser) thumbnail
    YouTube

    Syncing projects with Google Drive - Part 16 (Custom gitignore parser)

    I build a custom .gitignore parser in Go for my Google Drive sync tool, replacing the naive line-by-line matching with one that understands the full pattern syntax.

    Watch →
  17. Part 17
    Syncing projects with Google Drive - Part 17 (The shouldIgnore() func) thumbnail
    YouTube

    Syncing projects with Google Drive - Part 17 (The shouldIgnore() func)

    I write the shouldIgnore() function for my custom Gitignore parser in Go, deciding whether a given path should be ignored, skipped as a directory, or uploaded.

    Watch →
  18. Part 18
    Syncing projects with Google Drive - Part 18 (Connecting the new gitignore parser) thumbnail
    YouTube

    Syncing projects with Google Drive - Part 18 (Connecting the new gitignore parser)

    I connect my custom gitignore parser to DriveSinker's sync algorithm by replacing the old ignore checks with a single GitIgnore.shouldIgnore call.

    Watch →
  19. Part 19
    Syncing projects with Google Drive - Part 19 (oAuth web server) thumbnail
    YouTube

    Syncing projects with Google Drive - Part 19 (oAuth web server)

    I build a minimal Go web server on localhost:8998 to handle Google OAuth callbacks and capture the authorization code from the redirect, so re-authenticating doesn't dump you on the broken localhost page.

    Watch →
Hassan Aziz pointing up

Dude, you’re at the bottom of my landing page.

Just book a call already if you’re that interested.

You scrolled all the way here.

Book a free call on Calendly