AUTOMATION

Automating ChatGPT Access to Website Data via Google Drive

A technical detective story of 201 stray files, a broken Git and the architecture that helped find the right solution

CASE AT A GLANCE

  • Year 2026
  • Region Ukraine
  • Services Automating the transfer of site structure for reading
  • Tools Task Scheduler, PowerShell, Google Drive
  • Result Task Solution

CLIENT

FROM

HOW IT ALL BEGAN

A ChatGPT library cluttered with outdated ((2), (3), (6) etc) and unnecessary versions of analysis files forced me to clean it up, leading to a strict decision never to let that happen again. Back then, I couldn't have imagined that I would soon have to investigate the appearance of completely different files

Context Using generative artificial intelligence to assist in website, applications and software creation is no longer news to anyone. But manually pasting HTML, CSS, JS, Python and other files into a chat after every edit gets old rather quickly. It was necessary to build a workflow for editing the project that simultaneously granted the AI assistant automatic read access to live source files.

Targets The goal was clear and straightforward: to direct ChatGPT to the necessary website sections and files with a single phrase, eliminating the need to upload any additional materials into the chat. Investing time into this setup was well worth it for a much more convenient, faster, and efficient workflow moving forward.

Execution At first glance, there seemed to be nothing complicated about it. It was only necessary to take a few simple steps:

  1. Install the Google Drive app on your computer.
  2. Synchronize the local project folder with cloud storage.
  3. Grant read-only access to a folder from Google account #1 to Google account #2.
  4. Install the Google Drive plugin in ChatGPT and authorize Google account #2 within it.

With the Google Drive connection available to me, I couldn't restrict ChatGPT's access to a single folder. So I used a separate Google account with read-only access to the project files.

Configuring the Google Drive plugin in ChatGPT in Read-Only mode and with the only enabled skill for the disk itself.
Configuring the Google Drive plugin in ChatGPT in Read-Only mode and with the only enabled skill for the disk itself.

Once implemented, everything worked instantly! All it took was hinting at an error or bug, and the generative system immediately provided answers and solutions without requiring extra explanations or file uploads. It even felt like my colleague (as ChatGPT and I mutually refer to each other) was genuinely, humanly thrilled about it! However, the detective story was only just beginning, and the most interesting part was yet to come.

Schematic diagram of the initial automation architecture for local project data transfer to ChatGPT that led to a conflict
Schematic diagram of the initial automation architecture for local project data transfer to ChatGPT that led to a conflict

The Incident During routine day-to-day work, everything went smoothly, and synchronization ran strictly according to the plan built into the implemented automation. That lasted until it was time for the next deployment of the updated project version.

THE CASE OF THE UNINVITED FILE

While syncing changes via VS Code, victim in the case Git reported a repository error caused by hidden Windows system configuration files responsible for preserving the visual layout of project folders

When attempting to commit, Git returned the error message: fatal: bad object refs/desktop.ini. Until that day, I had no idea what this file was or what it did simply because I neither needed to know nor cared. However, given how critical local project syncing with the AI was, I had to dive deep into the issue.

desktop.ini was the suspect, but the answer lay in the architecture

The 201 stray files were clues in the investigation. The breakthrough came not from blaming a particular application, but from reconsidering how the tools accessed each other's files.

It looked as if someone had planted a foreign object at a crime scene. And that turned out not to be so far from the truth: an unfamiliar system file had indeed ended up inside .git.

The suspicious element contained [.ShellClassInfo] and an IconResource path pointing to GoogleDriveFS.exe. This connected the folder appearance to Google Drive, but the record alone could not prove which process had written each file: Windows, Google Drive client, or their interaction.

PowerShell / Git

        Git: fatal: bad object refs/desktop.ini
        [.ShellClassInfo]
        IconResource=...\GoogleDriveFS.exe,27
    
The error that started the investigation

Investigation At first glance, the obvious fix was to add desktop.ini to .gitignore and move on. But this file only controls what Git tracks in the working tree. It does not stop other programs from writing inside Git’s internal .git directory.

A screenshot showing the consequences of Windows interfering with the display of a project's internal folders due to synchronization with the Google Drive cloud.
A screenshot showing the consequences of Windows interfering with the display of a project's internal folders due to synchronization with the Google Drive app.

We removed the first stray copy, only for git fsck --full to reveal a long list: more files were scattered across refs, heads, remotes, tags, and object subdirectories. There were 201 of them. At that point, I was no longer eager to find out what the next terminal message might say.

The most important thing in such a situation is to stop and think, rather than starting to delete everything indiscriminately. Before cleaning up, we backed up .git with robocopy outside the synced directory. Only then did we remove files named exactly desktop.ini and inspect the actual repository objects.

PowerShell / Git

        git fsck --full
        # before cleanup: bad sha1 file .../desktop.ini
        # after cleanup:
        Checking objects: 100% (1033/1033), done.
        git status -sb
        ## main...origin/main
After cleanup: 1,033 objects verified, with no stray files interfering.

Recovery GitHub had not yet received the latest update: the local main branch was one commit ahead of origin/main. Key witness in the case, VS Code could still show it in history, but that was hardly a reason to push blindly while fetch was failing.

After the backup, cleanup, and integrity checks, git fetch origin finally succeeded. A regular git push origin main then published commit d5f3a60. GitHub and Netlify accepted the publication, the deployment went through without errors, and it became clear that the negative consequences of the processes had been overcome.

The Decision We could have kept deleting this file after every conflict or switched cloud providers. Dropbox was considered too. But the broader issue was not just one application: Git’s internal database should not be handed to a file-sync client that has no awareness of its internal operations.

The decision was made to separate the project into two local directories. The original remained the working Git repository, no longer synced directly with Google Drive, while the second became a dedicated copy for sharing project files. Instead of syncing the source folder with the cloud, we established a controlled, automated one-way transfer from the working directory to its separate counterpart.

The New Architecture

LOCAL RESOURCE 1D:\projectVS Code · Git · source code
LOCAL RESOURCE 2D:\project-copyWithout .git or .venv
GOOGLE ACCOUNT 1Google Drive cloudAutomatic upload
GOOGLE ACCOUNT 2ChatGPTReading current project files
Separate Deployment Route

Git → GitHub → Netlify

The cloud copy neither deploys the website nor touches its commit history.

Automation We started by running Robocopy directly: the initial transfer copied 263 required files - HTML, CSS, JavaScript, Python, images, SVG, PDFs, and other assets. The .git directory, .venv, caches, and temporary folders were excluded. Test-Path confirmed that the internal directories were absent.

Then we wrapped the command in one script instead of manual chores: sync-from.ps1, with source and destination paths, exclusion rules, and an exit-code check. It looked finished - except that running the script manually every time is not really automation. I wanted the computer to do its own share of the work.

PowerShell / Git

        $source = "D:\project"
        $destination = "D:\project-copy"

        robocopy $source $destination /E `
            /XD ".git" ".venv" "__pycache__" ".tmp.drivedownload" ".tmp.driveupload" `
            /XF "desktop.ini" `
            /R:1 /W:1

        if ($LASTEXITCODE -ge 8) {
            Write-Host "Synchronization failed." -ForegroundColor Red
            exit 1
        }

        Write-Host "Cloud copy updated successfully." -ForegroundColor Green
    
The essential working sync script. It does not delete files already removed from the source.
TASK SCHEDULER

A Windows operating system service for automatically launching programs or scripts, or performing specific actions according to a set schedule or upon the occurrence of certain conditions

Planning A Task Scheduler job was set up to execute a PowerShell script at logon with a five-minute repeat interval. Everything seemed configured properly, yet no new files appeared in the target folder.

Testing the execution via the Run button succeeded. The issue wasn't the script itself—as it turned out, the task had been created in the middle of an active Windows session, so the “At log on” trigger hadn't fired its initial start signal yet.

After restarting the computer, we confirmed that file transfers continued automatically. We were ready to replace the trigger with a daily schedule, but this time a simple test of the hypothesis settled the matter.

201desktop.ini stray files
1,033Git objects verified
263files in the initial copy
5 minrepeat interval

Verification A green success message in the terminal did not prove the entire chain worked. So we checked every hop: files in the second local directory, Task Scheduler history, their presence in Google Drive, and whether they were readable through the second account.

The real test was not a synthetic example but the creation of a new website page. Files reached the isolated copy after the Windows logon and were then confirmed in the cloud. A control test proved that subsequent repetitions worked without another reboot.

An important qualification: we verified successful transfers and individual executions, not long-term latency or resilience across every possible Windows or network failure. The system works, but there is still room to improve it.

Results Now D:\project remains the real Git repository, while D:\project-copy is an isolated copy for Google Drive. Task Scheduler runs sync-from.ps1 without manual intervention, the Drive app uploads changes to the first account, and the second provides access for collaborative review.

Schematic diagram of the revised automation architecture for transferring local project files to ChatGPT through an isolated workflow
Schematic diagram of the revised automation architecture for transferring local project files to ChatGPT through an isolated workflow

The limitations are explicit. The current robocopy /E setup transfers new and updated items but does not remove files that were deleted from the source. Visibility depends on the scheduled interval and Google Drive itself. Automatic copying is not the same as deployment: GitHub and Netlify only receive changes after an intentional commit and push.

Conclusion Nearly a full day went not so much into building the automation system itself, as into untangling responsibilities across multiple tools involved. The internal .git directory should never have been included in cloud sync, Google Drive should never have touched it, and I certainly shouldn't have had to inspect two hundred folders by hand.

What did I take away from this quest? When a workflow breaks, don't rush to look for software bugs. First understand what each tool actually does, what it controls, and where it has access.

Interesting facts “I also asked your brother Gemini (or whatever your relationship is?) what he thought about our situation.” That's how I introduced another AI's suggestions to detective ChatGPT.

The response was a diplomatic technical review: “Gemini isn't my brother. We're more like colleagues in the same digital industry. His theories are worth hearing out, but every one needs testing. We already have plenty to deal with, plus one uninvited guest - desktop.ini - and it managed to leave 201 traces inside Git.”

The family ties between the two AI systems remained unresolved. The technical mystery, however, was solved - and the unexpected visitor no longer had access to the scene.

Personal Contribution This case study isn’t about me writing a script single-handedly. I worked together with ChatGPT. I set tasks, worked with VS Code and Windows tools, executed commands, paused risky steps, tested hypotheses, and made the final decisions.

The AI assistant helped interpret logs, explain commands, propose architecture options, prepare the PowerShell script, and structure the diagnostics. Some suggestions needed revision as new evidence appeared. There is no reason to hide that part of the process.

I believe that this specific distribution is important: the tool accelerates exploration but does not replace human accountability. I do not claim credit for assistance I received, nor do I hand over decisions whose consequences I would have to fix.

End Credits Case closed. Poor desktop.ini was released from custody and declared innocent! Repo is running. Automation under control.

CAST

Act I. The Crime Scene

Windows 10 The alleged mastermind. Was in charge of folder formatting, yet under questioning cited system preferences as his defense
Google Drive app Suspect No. 2. Had access to the scene. Relocated to a different territory
desktop.ini Perpetrator of the crime. Left 201 traces and caused more trouble than expected
Visual Studio Code Key witness. First reported the incident to lead investigator
Git The victim. Detected unauthorized files on his own service territory that blocked his operations

Act II. The Investigation Team

Project author Lead investigator. Gathered evidence, tested theories and made the decisions
ChatGPT Consulting detective. Read the logs, developed theories and proposed fixes
Gemini Independent expert. Possibly related to the consultant. Family ties unconfirmed yet
PowerShell Special operations unit. Followed orders of investigators without unnecessary questions
git fsck --full Forensics lab. Inspected 1,033 repository objects and found no integrity errors after cleanup
git status -sb Duty informant. Reported the repository's current state and any outstanding changes
.gitignore Defense attorney. Explained what victim could ignore, but had no authority over files created inside .git

Act III. Rescue operation

Robocopy Evidence transport and evacuation. Left unrelated files untouched
D:\git-backups Secured investigation archive. Accepted backups in case events took an unexpected turn
sync-from.ps1 Head of transport operations. Defined the route, access restrictions, and rules for transferring materials
Task Scheduler Duty officer. Scheduled another deployment every five minutes
git fetch External liaison scout. Checked up-to-date records from the central repository
git push Special courier. Delivered the rescued commit to the main checkpoint without losses

Act IV. The Final Authorities

Google Drive cloud Central evidence repository. Provided access to up-to-date investigation materials
D:\project Operation headquarters. Stored the originals, the victim's history, and all working materials
D:\project-copy Secured transfer point. Received staged copies stripped of any foreign service files
Google Account #1 Archive owner. Was responsible for storing case materials and issuing clearances
Google Account #2 Accredited observer. Had permission to read the case files, but not to modify the shared originals
GitHub Main final checkpoint. Confirmed that deployment was restored
Netlify Court crier. Broadcast the verdict across the entire internet the moment the authority approved the documents

Any resemblance to actual software and AI systems is entirely intentional.

No desktop.ini files were harmed during this investigation.

THE END

Click the credits to pause or resume
KEEP EXPLORING
∧