Cloudflare Pages Auto-Push
Auto-commit and push your Cloudflare Pages project to GitHub on demand and proactively.
Configuration (set once per project)
| Variable | Value |
|---|---|
PROJECT_PATH |
Local path to the project root (e.g. ~/Desktop/my-project/) |
REMOTE_REPO |
GitHub remote (e.g. username/repo-name) |
BRANCH |
Deploy branch (usually main) |
Cloudflare Pages auto-deploys within ~60s of a push to the deploy branch.
When to Use
On-demand — user says any of:
- "push to github", "push it", "push changes", "update github", "commit and push"
- "save it", "deploy it", "ship it", "push this"
- Any phrase ending in "...to github" or "...to git"
Proactive — run WITHOUT being asked after any session where you:
- Edited HTML, JS, CSS, or content files in the project
- Added or deleted files
- Made any UI or content changes
The rule: if you touched the project, push it before the session ends.
Execution Steps
Step 1 — Check status
cd PROJECT_PATH
git status --short
git log --oneline -3
Step 2 — Stage all changes
cd PROJECT_PATH
git add -A
Step 3 — Commit with a descriptive message
Generate a message describing WHAT changed — not just "update files".
Format: <type>: <summary of actual changes>
Examples:
feat: hero section redesign, added testimonials gridfix: mobile nav overflow, contrast ratio on CTA buttonchore: cleanup temp files, update content
git commit -m "<generated message>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>"
If nothing to commit, skip to Step 4.
Step 4 — Push
cd PROJECT_PATH
git push origin BRANCH 2>&1
Step 5 — Confirm
Report the commit hash and confirm push succeeded:
✅ Pushed
abc1234toREMOTE_REPO— Cloudflare Pages will deploy in ~60 seconds.
Proactive Auto-Push (End of Session)
At the end of any session where project files were modified:
git status --short— check for unstaged changes- If any exist — run Steps 1–5 above WITHOUT asking
- If clean — confirm: "Repo is clean, nothing to push."
Error Handling
| Error | Fix |
|---|---|
nothing to commit |
Skip commit, still try push in case local branch is ahead |
rejected (non-fast-forward) |
git pull --rebase origin BRANCH then retry push |
remote: Permission denied |
Check git credentials — re-auth needed |
| Merge conflict | Stage safe files, flag conflicted files to user |
Rules
- Never force-push (
--force) to the deploy branch - Never skip pre-commit hooks (
--no-verify) - Always include
Co-Authored-Bytrailer in commit message
Related Skills
cloudflare-expert— Cloudflare configurationvercel-deploy— alternative deploymentci-cd-pipeline-builder— deployment pipelines
GitNexus Index
This skill is indexed by GitNexus for knowledge graph traversal. Index path: /Users/localuser/.claude/skills/cloudflare-pages-autopush/.gitnexus Last indexed: 2026-05-23