When running from a worktree, main is checked out in the primary tree, so the pull/push must be run from there instead.
1.7 KiB
1.7 KiB
Create a PR on Gitea, wait for CI, and squash-merge it. Push code to both remotes.
- If in a worktree (working directory contains
.claude/worktrees/), you are already on a feature branch — do NOT create a new one. Otherwise, create a new branch from main with a descriptive name. - Stage and commit all changes with a clean, semantic commit message. No Claude attribution lines.
- Fetch latest main and rebase:
git fetch gitea main && git rebase gitea/main.- If conflicts occur, abort the rebase (
git rebase --abort), analyze the conflicting files, write a plan to resolve them, and present the plan to the user before proceeding.
- If conflicts occur, abort the rebase (
- Push the branch to both remotes:
git push -u gitea <branch> && git push origin <branch>(use--force-with-leaseif already pushed). - Create a Gitea PR:
tea pr create --head <branch> --base main. Reference related issues with#X. Only useCloses #Xif the PR fully resolves the issue. - Wait for CI to pass: poll Gitea CI status. If CI fails, report the failure and stop — do not merge.
- Once CI passes, squash-merge on Gitea:
tea pr merge <index> --style squashwith a clean, semantic commit message including the PR number. No Claude attribution lines. - Update local main and push to both remotes. If in a worktree,
mainis checked out in the primary tree, so run from there:cd <primary-worktree> && git pull gitea main && git push origin main(the primary worktree path is the repo root without.claude/worktrees/…). If not in a worktree:git checkout main && git pull gitea main && git push origin main. - Clean up remote branches:
git push gitea --delete <branch> && git push origin --delete <branch>. - Prune refs:
git remote prune gitea && git remote prune origin. - Report the merged PR URL.