Help: stuck moving a commit from a Claude Code on the web sandbox into my GitHub repo
My setup:
OS: Windows
Editor: Cursor IDE (with built-in terminal)
Repo: A private GitHub repo I own
Auth: I added an SSH key to my GitHub account
Tool: I was using Claude Code on the web (the cloud-sandbox flavour of Claude Code, not the local CLI)
What I'm trying to do:
I asked Claude (in a Claude Code on the web session) to make some code changes for me. Claude did the work inside its cloud sandbox — it created a feature branch (let's call it fix/my-branch) and committed 4 file changes (commit hash 6af1c3f).
I now want to:
Get that commit onto my local clone of the repo.
Push it to GitHub.
Open a pull request.
The complication:
The Claude sandbox can't push to GitHub itself — it doesn't have my GitHub credentials. So Claude exported the change as a git format-patch output (a 559-line .patch block starting with From 6af1c3f3510915db259d531333f46adc8a9abf5c Mon Sep 17 00:00:00 2001) and told me to apply it locally with git am drift.patch.
What I tried:
On my local Windows machine in Cursor's terminal:
cd <repo>
git checkout main
git checkout -b fix/my-branch
git push -u origin fix/my-branch
Output of the push:
branch 'fix/my-branch' set up to track 'origin/fix/my-branch'.
Everything up-to-date
Then I went to GitHub to open the PR. GitHub shows:
"There isn't anything to compare. main and fix/my-branch are identical.
Showing 0 changed files with 0 additions and 0 deletions."
Diagnosis (I think):
The branch exists on GitHub but points at the same commit as main. I created a new empty branch, pushed it, but never actually applied the patch that contains commit 6af1c3f. So my local branch and the remote branch are both empty relative to main.
I think what I need to do is:
Save Claude's .patch output as a file on my local disk.
Run git am drift.patch to land commit 6af1c3f on my current branch.
git push again.
But I'm new to git am and patch files, and I'm worried about:
Line endings: I'm on Windows. The patch was generated on a Linux sandbox. If I paste it into Notepad or Cursor and save, will CRLF vs LF mess up git am?
Copy-paste: Pasting 559 lines of patch text from a chat into an editor feels brittle. Is there a safer way to transfer a patch from a cloud sandbox to my local machine?
What success looks like: I don't have a clear mental model of what git am will print when it works, vs. what failures look like.
My specific questions:
What's the correct sequence of commands in Cursor's terminal on Windows to save a git format-patch blob from my clipboard to a file, apply it with git am, and push?
Is there a better workflow for "Claude did work in a cloud sandbox, I want it on my GitHub" than the patch-paste dance? (I've heard the Claude Code GitHub App might help — does installing it let future sessions push directly?)
If git am errors with "patch does not apply" or "corrupt patch", what's the standard way to recover?
What I'd ideally get back:
A short worked example: 4-5 commands I can copy into Cursor's terminal that, given a .patch file in the repo root, lands the commit on my current branch and pushes it. Plus a one-paragraph "here's what to do if X goes wrong" for the common failures.
I'm reasonably comfortable with add/commit/push/branch but git am, patch files, and line-ending issues on Windows are new territory.
Thanks in advance — I've been stuck on this for a day and just want to confirm I'm not missing a simpler path.
1
1 comment
Memo Boyraz
1
Help: stuck moving a commit from a Claude Code on the web sandbox into my GitHub repo
Data and Ai Automations
skool.com/data-and-ai
For operators and builders who want to actually profit from AI — not just learn about it.
Leaderboard (30-day)
Powered by