git-merge-main
Use when merging the main branch into the current feature branch to pick up upstream changes.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Use when merging the main branch into the current feature branch to pick up upstream changes.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Use when designing component interaction specs with visual states, transitions, and accessibility requirements. Covers state matrices, responsive behavior, ARIA compliance, and content constraints. Do not use for multi-step user journey mapping (use journey-mapping).
Use when mapping complete user journeys through multi-step flows, onboarding sequences, or feature workflows. Covers entry points, happy paths, alternate paths, error states, friction analysis, and delight opportunities. Do not use for individual component interaction specs (use interaction-design).
Use when analyzing an existing codebase for architecture, tech stack, conventions, and infrastructure. Covers project structure mapping, data model discovery, integration point cataloging, and constraint identification. Do not use for schema changes (use schema-design) or API contract definition (use api-design).
Use when designing documentation architecture for a project or team. Covers audience mapping, Diataxis framework classification, onboarding path design, format and location decisions, documentation testing, and maintenance scheduling. Do not use for recording individual architecture decisions (use adr-template) or creating versioned changelogs (use changelog-design).
Use when auditing codebase patterns or evaluating proposed changes for convention consistency. Covers file naming, component patterns, data fetching, state management, and type conventions. Do not use for test plan design or coverage targets (use testing-strategy).
Use when classifying data elements by sensitivity tier and defining per-tier handling requirements. Covers data inventory, sensitivity classification, PII flow mapping, encryption and masking specifications, and cross-boundary transfer documentation. Do not use for regulatory gap analysis (use compliance-review) or audit logging design (use audit-trail-design).
| name | git-merge-main |
| description | Use when merging the main branch into the current feature branch to pick up upstream changes. |
| triggers | ["git merge main","merge main","update from main","sync with main","get latest main"] |
| version | 1.0.0 |
| user_invocable | true |
.., shell metacharacters, or null bytes.--no-commit accepted. Reject arbitrary strings.Merge the latest main branch into your current feature branch to get updates.
/git-merge-main # Merge main into current branch
/git-merge-main develop # Merge develop instead of main
/git-merge-main --no-commit # Merge but don't commit (for review)
# Get current branch
CURRENT=$(git branch --show-current)
# Cannot merge main into main
if [ "$CURRENT" = "main" ] || [ "$CURRENT" = "master" ]; then
echo "Already on main branch. Nothing to merge."
echo "Did you mean /git-pull?"
exit 1
fi
# Check for uncommitted changes
if ! git diff --quiet || ! git diff --cached --quiet; then
echo "You have uncommitted changes."
echo "Options:"
echo " /git-stash - Stash changes first"
echo " /commit - Commit changes first"
exit 1
fi
# Fetch latest main from remote
git fetch origin main:main 2>/dev/null || git fetch origin main
# Show what will be merged
echo "Commits from main to be merged:"
git log --oneline HEAD..origin/main | head -20
# Preview merge (without committing)
if ! git merge --no-commit --no-ff origin/main 2>/dev/null; then
echo "Merge will have conflicts."
git merge --abort
# Show conflicting files
git diff --name-only --diff-filter=U
fi
# Perform the merge
git merge origin/main --no-ff -m "Merge main into $CURRENT"
# Or without commit for review
git merge origin/main --no-commit --no-ff
Show merge result and any follow-up needed.
Merging main into feat/dark-mode...
Merged 5 commits from main:
abc1234 Fix security vulnerability
def5678 Update dependencies
ghi9012 Improve performance
jkl3456 Add new API endpoint
mno7890 Documentation updates
Files updated:
package.json
src/api/endpoints.ts
src/utils/security.ts
README.md
Merge complete! Your branch now includes all changes from main.
Next steps:
- Test your feature still works
- /git-push to update remote branch
Branch feat/dark-mode is already up to date with main.
No merge needed.
Merge conflicts detected!
Conflicting files:
- src/components/Header.tsx (both modified)
- src/styles/theme.css (both modified)
To resolve:
/git-conflicts # Get help resolving
After resolving:
git add <resolved-files>
git commit
To abort:
/git-abort
When using --no-commit:
Merge staged but not committed.
Changes from main:
M src/api/endpoints.ts
M package.json
A src/utils/newHelper.ts
Review the changes, then:
git commit -m "Merge main into feat/dark-mode"
Or abort:
git merge --abort
/git-rebase instead| Merge | Rebase |
|---|---|
| Preserves complete history | Creates linear history |
| Shows when integration happened | Looks like sequential development |
| Better for shared branches | Better for personal branches |
| Non-destructive | Rewrites commit history |
/git-sync first to see what's on main/git-rebase for cleaner history (alternative)/git-conflicts if merge has conflicts/git-abort to cancel a failed merge