Perform manual merge to main branch with automated conflict resolution and PR management
Executes complete branch merge to main with automated conflict resolution and validation.
/plugin marketplace add leobrival/topographic-plugins-official/plugin install dev@topographic-plugins-officialComplete merge workflow from current branch to main with conflict resolution.
Check current state:
# Verify on feature branch
git branch --show-current
# Ensure all changes committed
git status
# Check for uncommitted changes
if [ -n "$(git status --porcelain)" ]; then
echo "Uncommitted changes found"
# Run /commit if needed
fi
Fetch latest main:
git fetch origin main
Preview merge conflicts:
git diff origin/main...HEAD
Finalize changes:
/commit firstCreate PR:
gh pr create \
--base main \
--title "[Feature] Clear description" \
--body "## Changes
- Implemented [feature]
- Fixed [issue]
## Testing
- All tests passing
- TypeScript compilation passes
- Linting passes
## Related Issues
Closes #123"
Check for conflicts:
gh pr view --json mergeable,mergeStateStatus
If conflicts detected:
Analyze conflicts:
git merge-tree $(git merge-base HEAD origin/main) HEAD origin/main
Resolution strategy:
Automatic resolution (when safe):
Manual resolution required:
Apply resolution:
git checkout main
git pull origin main
git merge <feature-branch>
# Resolve conflicts
# Test the merged code
Verify resolution:
Run validation suite:
MANAGER=$(
if [ -f "pnpm-lock.yaml" ]; then echo "pnpm"
elif [ -f "yarn.lock" ]; then echo "yarn"
elif [ -f "bun.lockb" ]; then echo "bun"
else echo "npm"
fi
)
$MANAGER run lint
$MANAGER run typecheck
$MANAGER run test
$MANAGER run build
Wait for CI checks:
gh pr checks
Merge PR:
gh pr merge --auto --squash --delete-branch
Options:
--squash: Squash all commits into one (cleaner history)--merge: Keep all commits (preserve history)--rebase: Rebase and merge (linear history)--delete-branch: Clean up feature branchVerify merge:
git checkout main
git pull origin main
git log --oneline -5
Cleanup:
# Delete local feature branch
git branch -d <feature-branch>
# Verify remote cleanup
gh pr list --state closed --limit 5
Merge Complete
Branch: feature/user-authentication
PR: #123 - Add user authentication
Merge type: Squash
Summary:
- X files changed
- Y insertions, Z deletions
- 0 conflicts (or N auto-resolved)
- All CI checks passed
Main branch updated successfully.
# Basic usage
/merge-to-main
# After feature complete
/merge-to-main
/commit firstgh auth login