Documentation
Dual-workflow Git
Dual-workflow Git operating guide#
This repo is used from two environments:
- local Cursor app
- Cursor web agents
The goal is zero branch drift and safe handoff between both.
Core model#
mainis the stable integration branch.- day-to-day work happens on short-lived topic branches.
- every environment pulls from/pushes to the same remote branch for that topic.
Branch naming#
Use names that identify intent and owner quickly:
feature/<topic>fix/<topic>chore/<topic>cursor/<topic>(for agent-heavy runs)
Examples:
feature/wider-home-converterfix/pdf-table-overflowcursor/pagination-hardening
Session start (both platforms)#
Run:
npm run git:sync
What this does:
- fetches latest remote refs
- ensures the current branch tracks its upstream (or creates it on remote)
- rebases local work onto upstream with
--autostash
Then inspect:
npm run git:status
Session end / handoff#
Before switching platforms:
- commit all intended changes
- push branch
- confirm upstream is in sync
git add .
git commit -m "your message"
git push
npm run git:status
Keep flexibility without chaos#
- avoid direct work on
mainfor ongoing tasks - avoid force-push on shared branches
- keep commits focused and small so handoffs are easy
- when opening a new effort, branch from latest
origin/main
Fast recovery recipe#
If the local branch looks wrong:
git fetch --all --prune
git status -sb
git log --oneline --decorate -n 10
If needed, explicitly compare with remote:
git rev-list --left-right --count @{u}...HEAD
This tells you exactly how far ahead/behind you are before taking action.