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 build a Google Drive syncer in Go, starting with the Google Cloud Console and OAuth setup so I can back up local coding projects to Drive as a second backup alongside GitHub. After losing unpushed local changes when…

    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 build a config-driven Google Drive syncer in Go, cleaning up the entry point and adding a reusable Drive struct plus JSON configuration for deciding which project folders and files get uploaded. I refactor the OAuth…

    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 side of my Google Drive sync tool in Go, creating folders on Drive and uploading every file from a configured local folder into them. I build an uploadFolder function that creates a project…

    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 add subfolder support and duplicate-folder handling to my Google Drive project syncer, so re-syncing a project replaces the old Drive folder instead of creating duplicates and preserves nested folder structure. I use…

    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 filtering to my Google Drive sync tool so it skips secrets and build artifacts during upload. I build a readGitIgnore function that opens each project's .gitignore, scans it line by line with…

    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 add automatic OAuth token refreshing to my Google Drive syncer so I can stop manually reauthorizing every time an access token expires. I build a testAccess check around a tiny drive.files.list call with pageSize 1…

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

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

    Before building the CLI for my Drive syncer, I spend this session reorganizing the codebase, moving everything out of main.go and sync.go into proper Go packages: internal/models for shared structs, auth for OAuth…

    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 Cobra CLI for my Go Google Drive syncer so I can run commands like go run . sync instead of hard-coding uploads in main.go. I install Cobra, create a cmd package with a root command, define an Execute…

    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 the DriveSyncer upload multiple Google Drive projects concurrently and add live per-project progress bars. I move each folder upload into a goroutine, use a sync.WaitGroup to run all projects simultaneously, and…

    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 start building a more efficient Google Drive sync algorithm that stops deleting and reuploading an entire project folder on every sync, and I fix the upload progress bars so they reliably reach 100%. I fix the…

    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)

    To stop my Drive syncer from uploading duplicate files, I build the mapping between local project folders and their Google Drive counterparts. I write a walkProjectTree function in Go that recursively walks the entire…

    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 build a shouldUpload method into the DriveSyncer tracker so my Google Drive sync only uploads files whose local checksum differs from the remote checksum, and skips unchanged files entirely. I show how the sync…

    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 implement overwriting existing files in my Google Drive sync algorithm so modified local files update on Drive instead of creating duplicate uploads. In the uploadFile function in api/sync.go, I query Drive by file…

    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)

    Ghost files are files you've deleted from your local project that still sit on Google Drive taking up space, and I fix that by collecting every local file and folder path during the upload walk, then comparing them…

    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 fix the bugs I introduced in the DriveSyncer project before moving on: projectExists now checks the folder name instead of matching any folder under the programming parent, I silence the noisy project-tree logs, and…

    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 DriveSyncer project so it can decide which files and folders to skip when uploading projects to Google Drive. I create ignore.go with a GitIgnore struct and an…

    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 build the shouldIgnore() function for my custom Gitignore parser in Go, which decides whether DriveSinker should upload a file, ignore a file, or skip an entire directory. I convert absolute paths to relative paths…

    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 the DriveSyncer sync algorithm, replacing the old string-based ignore list with a GitIgnore struct that exposes shouldIgnore. I refactor countTotalFiles and uploadFolder to stop…

    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 temporary web server that handles Google OAuth callbacks on localhost:8998 so I can stop copying authorization codes from the broken localhost redirect page. I update the redirect URI in client.json…

    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.