xiaohongshu
xiaohongshu
git-merging-feature-branches-to-main-skill
Use when feature branch is complete and reviewed, ready to merge to main - squashes multiple commits into single clean commit in main using git merge --squash
Full skill instructions
Merge a completed and reviewed feature branch into main using git merge --squash to create a single clean commit in main's history.
Core principle: Main branch shows feature-level history (one commit per user story), not development-level history (many TDD commits).
Workflow context:
finishing-a-development-branch)Use this skill when:
Do NOT use when:
finishing-a-development-branch first)We use TDD which creates many commits during development (test, implementation, refactor cycles). These granular commits are valuable during development but should be squashed to one commit when merging to main.
Before starting, verify:
# 1. Check current branch (should be on feature branch)
git branch --show-current
# 2. Verify working directory is clean
git status
# Should show "working tree clean"
# 3. Ensure all work is committed
git log --oneline -5
# Review recent commits to confirm work is saved
# 4. Verify main branch exists
git branch -a | grep main
If any check fails, STOP and resolve before proceeding.
git checkout main
If you have a remote, update main:
git pull origin main
git merge --squash <feature-branch-name>
This stages all changes from feature branch WITHOUT creating a commit yet.
Verify changes are staged:
git status
# Should show "Changes to be committed"
REQUIRED SUB-SKILL: Use create-git-commit skill to craft the commit message.
Do NOT write commit message manually. The create-git-commit skill ensures proper format, scope, and message quality.
# The create-git-commit skill will guide you through:
# - Analyzing the staged changes
# - Following repository commit message conventions
# - Creating a well-formatted commit message
After create-git-commit skill creates the commit, verify:
git log --oneline -1
# Should show your new squashed commit
After successful merge, clean up the feature branch:
# Force delete (required since squash doesn't create merge commit)
git branch -D <feature-branch-name>
Why -D: The -D flag force-deletes because --squash doesn't create a merge commit, so git doesn't recognize the branch as "merged" with -d.
git push origin main
Confirm main branch has clean history:
# View recent commits
git log --oneline -5
# Verify one commit for the feature (not 10+)
# Verify commit message follows conventions
Run tests on main to ensure everything works:
npm test
# Or your test command
| Problem | Solution |
|---|---|
| Uncommitted changes on feature branch | Commit or stash changes before switching |
| Merge conflicts after squash | Resolve conflicts, git add files, then create commit |
| Feature branch not found | Verify branch name with git branch -a |
| Already on main branch | Checkout feature branch first, or specify branch name differently |
| Branch deletion fails | Use -D flag for force delete (squash merges don't mark as "merged") |
# Complete workflow
git checkout main
git pull origin main # If using remote
git merge --squash <feature-branch>
# Use create-git-commit skill here
git branch -D <feature-branch>
git push origin main # If using remote
git log --oneline -5 # Verify
git commit -m "Add feature" # WRONG
git branch -d feature-x # FAILS
# Error: not fully merged
git branch -D feature-x # WORKS
# Squash merges require force delete
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience