| name | Mecris Rebase |
| description | Safely resolves git conflicts and ensures successful pushes during autonomous sessions. Use when git pull --rebase fails. |
Mecris Rebase
Guided workflow for resolving git conflicts when upstream changes interfere with an autonomous push.
Workflow
1. Diagnose Conflict
Identify which files are in "both modified" state.
git status
2. Surgical Resolution
For each conflicted file:
- Analyze: Use
read_file or grep to see the conflict markers (<<<<<<<, =======, >>>>>>>).
- Cooperative Decision:
- If the conflict is in logs or documentation (
session_log.md, NEXT_SESSION.md), merge the information from both.
- If the conflict is in core logic, prefer the upstream changes (
theirs) unless the bot's task specifically required a fix in that spot.
- Use
git checkout --ours <file> or git checkout --theirs <file> for clean binary/full-file choices.
- Edit: Manually resolve markers if a merge is needed.
- Stage:
git add <file>
3. Verify Integrity
NEVER continue a rebase without verifying the build and tests.
- Build: If Android code was touched, run
cd mecris-go-project && ./gradlew assembleDebug.
- Test: Run
PYTHONPATH=. .venv/bin/pytest.
4. Continue & Push
- Continue:
git rebase --continue (or git merge --continue).
- Verify History:
git log --oneline -5.
- Push:
git push origin main.
Guidelines
- Don't give up: If a rebase fails, you have plenty of turns to resolve it.
- Stay Atomic: Keep the commit history clean.
- Document: Add a note to the
session_log.md about the conflict resolution.
Activation
Use when: "push failed", "git conflict", "rebase failed", "diverged branches".
Closing
"Conflict resolved and changes pushed to main. History is now synchronized."