Resolve merge conflicts when upgrading SaaS Pegasus. Use when the user has merge conflicts after running git merge during a Pegasus upgrade, or when they need help with the merge process.
This skill helps users resolve merge conflicts when upgrading their SaaS Pegasus codebase. Most users will invoke this skill when they have merge conflicts after merging their main branch into a Pegasus upgrade branch, but you can also help run the merge process for them.
First, determine what the user needs help with by checking their current state:
git status to see if there's an active merge in progressgit merge and need help resolving conflicts (most common)The user has already run git merge <main branch> and has conflicts to resolve. Help them resolve the conflicts using these strategies:
./manage.py makemigrations after all conflicts are resolvedgit checkout --theirs <migration-file> for each conflicted migrationpyproject.toml, requirements.in, package.jsonuv.lock, requirements.txt, package-lock.jsongit checkout --ours <lock-file> and git add <lock-file>uv sync (for uv.lock) or npm install (for package-lock.json) right after resolving to ensure dependencies are properly syncednpm run build or npm run dev after mergeIf the user wants you to run the merge:
git fetch to download the latest branches and commits from the remote (this ensures you can see the latest Pegasus upgrade branch)git branch -a to list all branches and look for the latest Pegasus upgrade branch (usually prefixed with pegasus-YYYY.MM, e.g., pegasus-2025.01)git status to see if they're already on the upgrade branchgit checkout <pegasus-branch-name>git pull to ensure the upgrade branch is up to date with the remotemain or master)git merge <main-branch> to merge the main development branch into the Pegasus upgrade branchAfter all conflicts are resolved and the merge is complete, ask the user if they want to proceed with the post-merge steps or if they prefer to do them manually later.
If the user wants to proceed, run these steps:
./manage.py makemigrations to create new migrations if neededuv sync (or pip install -r requirements.txt)npm installnpm run build (or npm run dev for development)./manage.py migrate to apply database changesmake upgrade instead of manual steps abovegit push to push the merged changes to GitHub. Once pushed, the upgrade branch should be ready to merge into the main branch via pull requestIf the user prefers to do these manually, inform them what steps they should take when ready.
git config rerere.enabled true to remember conflict resolutions for future upgradesUser: "I have merge conflicts after upgrading Pegasus"
You: [Check git status, see conflicts in migrations and uv.lock]
You: "I can see you have conflicts in migrations and uv.lock. Let me help resolve these:
- For migrations: I'll keep your version and we'll regenerate them
- For uv.lock: I'll accept the Pegasus version and regenerate it
[Proceed to resolve conflicts]"
User: "Can you help me merge my changes into the Pegasus upgrade branch?"
You: "I can help with that. Let me:
1. Find the latest Pegasus upgrade branch
2. Check out that branch (or confirm you're already on it)
3. Merge your main development branch into it
4. Help resolve any conflicts that come up
[Proceed with finding branch and running git merge main]"
pegasus-YYYY.MM branch, direct them to the Pegasus upgrade documentation