Automated summary
Guides an agent through partial git merges of selected folders or files and squash merges that collapse a branch into a single commit.
Strengths
- Clearly separates partial-merge and squash-merge workflows with dedicated steps.
- Checks the current branch and working-tree state before making changes.
- Provides exact command sequences and concrete examples for each strategy.
- Includes verification steps using git log, git diff, and git status.
Limitations
- Does not explain conflict resolution when the checkout or merge fails.
- Partial checkout overwrites the target paths and can discard local modifications.
- The push step is incomplete and lacks remote safety checks.
Use when integrating only specific folders or files from another branch, or when collapsing a feature branch into a single commit.
Avoid for full history-preserving merges or complex conflict-resolution and rebase scenarios.
Security analysis
CautionNo malicious, destructive, exfiltrating, or obfuscated behavior is present; the commands are standard git operations. However, the skill can alter branches, create commits, reset local history, and push to remotes, so it should be treated as a powerful-tool workflow requiring scoped permissions and user confirmation.
- •The skill provides shell/git commands that modify repository state, including checkout, merge --squash, commit, reset, and optional push.
- •No allowed-tools are declared, so the environment permissions for executing bash/git commands are unspecified.
- •Branch switching, merges, and commits are instructed without an explicit confirmation gate beyond the initial requirements gathering; push is user-confirmed.
- •No allowed-tools declared, yet the skill's instructions are entirely shell/git commands (checkout, merge --squash, reset, push); if executed, they mutate repository state and rewrite working trees.
- •Example 2 (`git push origin main`) pushes directly to main without the confirmation step described in Step 5, which conflicts with the skill's own human-in-the-loop guidance.
- •`git checkout <branch> -- <paths>` overwrites working-tree files in the target branch and can silently discard uncommitted local edits to those paths; the skill only warns about uncommitted changes at the branch-switch level, not per-path.
- •`git reset HEAD~1` / `git merge --squash` advice is generally safe but the skill does not emphasize verifying the correct target branch before reset/push operations.
Examples
Merge just the docs/ and config/ folders from feature-branch into main, then commit with a message describing the sync.Squash merge feature/user-authentication into main and create a single commit summarizing the JWT and OAuth changes.I need to partially merge the src/components folder from design-update into release. Check for uncommitted changes first and guide me through the safe steps.name: dev-swarm-git-merge description: Perform git partial merges (checkout specific folders from another branch) and squash merges (clean single-commit integration) to selectively integrate changes across branches.
AI Builder - Git Partial and Clean Merge
This skill helps you perform advanced git merge strategies including partial merges (checking out specific folders from another branch) and squash merges (clean single-commit integration).
When to Use This Skill
- User asks to merge specific folders or files from another branch
- User wants to perform a partial merge without merging the entire branch
- User asks to squash merge a feature branch into main
- User wants a clean, single-commit integration without preserving commit history
- User needs to selectively sync components between branches
Your Roles in This Skill
- DevOps Engineer: Execute git commands safely, verify branch states, and ensure clean merge operations.
- Project Manager: Guide the user through merge strategy selection and validate the merge scope.
Role Communication
As an expert in your assigned roles, you must announce your actions before performing them using the following format:
As a {Role} [and {Role}, ...], I will {action description}
This communication pattern ensures transparency and allows for human-in-the-loop oversight at key decision points.
Instructions
Follow these steps to perform git partial or clean merges:
Step 1: Understand the Merge Requirements
As a Project Manager, ask the user to clarify:
-
What type of merge do they need?
- Partial merge: Merge specific folders/files only
- Squash merge: Merge all changes as a single commit
-
For partial merge:
- Which source branch contains the folders/files?
- Which specific folders/files need to be merged?
- Which target branch should receive them?
-
For squash merge:
- Which source branch to merge from?
- Which target branch to merge into?
- What should the commit message be?
Step 2: Check Git Status
As a DevOps Engineer, verify the current state:
# Check current branch
git branch
# Check for uncommitted changes
git status
# View recent branches
git branch -a
Important: If there are uncommitted changes, ask the user whether to:
- Stash them:
git stash - Commit them first
- Abort the merge operation
Step 3: Perform the Merge
Option A: Partial Merge (Specific Folders/Files)
As a DevOps Engineer, execute the partial merge:
# Switch to the target branch (where you want the folders)
git checkout target-branch
# Checkout specific folders from source branch
git checkout source-branch -- path/to/folder1 path/to/folder2
# Stage the changes
git add path/to/folder1 path/to/folder2
# Commit the changes
git commit -m "Merge specific folders from source-branch"
Example:
# Merge only the docs and config folders from feature-branch to main
git checkout main
git checkout feature-branch -- docs config
git add docs config
git commit -m "Sync docs and config from feature-branch"
Option B: Squash Merge (Clean Single-Commit)
As a DevOps Engineer, execute the squash merge:
# Switch to target branch
git checkout target-branch
# Perform squash merge (stages all changes but doesn't commit)
git merge --squash source-branch
# Review staged changes
git status
# Commit with a meaningful message
git commit -m "Add feature: descriptive message summarizing all changes"
Example:
# Squash merge a feature branch into main
git checkout main
git merge --squash feature/user-authentication
git commit -m "Add user authentication feature with JWT and OAuth support"
Step 4: Verify the Merge
As a DevOps Engineer, verify the merge was successful:
# Check the commit was created
git log -1
# Verify the changes
git diff HEAD~1
# Check branch status
git status
Step 5: Push Changes (Optional)
As a Project Manager, ask the user if they want to push:
If yes, as a DevOps Engineer:
# Push to remote
git push origin target-branch
Merge Strategy Comparison
| Aspect | Partial Merge | Squash Merge | |--------|---------------|--------------| | Scope | Selective files/folders only | All changes from branch | | Commit History | Not applicable | Squashed into one commit | | Use Case | Selective sync of components | Clean integration of features | | Reversibility | Easy to revert specific files | Reverts entire feature at once |
Best Practices
Partial Merge:
- Always review changes with
git diffbefore committing - Use meaningful commit messages indicating source branch
- Verify the correct folders/files are staged before committing
Squash Merge:
- Write comprehensive commit messages that summarize all changes
- Review all staged changes before committing
- Document breaking changes or important notes in the commit message
- Consider keeping the source branch until changes are confirmed working
General:
- Always work on a clean working directory (commit or stash changes first)
- Test changes thoroughly after merge
- Communicate merge strategy with team members
- Use
git statusfrequently to verify state
Examples
Example 1: Merge Documentation from Feature Branch
git checkout main
git checkout feature/new-api -- docs/api
git add docs/api
git commit -m "Update API documentation from feature/new-api"
Example 2: Squash Merge Feature Branch
git checkout main
git merge --squash feature/shopping-cart
git commit -m "Add shopping cart feature with add/remove/checkout functionality"
git push origin main
Example 3: Merge Multiple Folders
git checkout develop
git checkout feature/redesign -- src/components src/styles
git add src/components src/styles
git commit -m "Merge redesigned components and styles from feature/redesign"
Common Issues
Issue: "error: pathspec 'folder' did not match any file(s) known to git"
- Solution: The folder/file doesn't exist in the source branch. Verify with
git ls-tree -r source-branch --name-only
Issue: Merge conflicts during squash merge
- Solution: Resolve conflicts manually, then
git addthe resolved files andgit commit
Issue: Accidentally merged wrong folders
- Solution: If not pushed yet, use
git reset HEAD~1to undo the commit, then repeat with correct paths
Issue: Uncommitted changes blocking checkout
- Solution: Stash changes with
git stash, perform merge, thengit stash pop
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/git-partial-and-clean-merges-mm8o52wi/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/git-partial-and-clean-merges-mm8o52wi' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/git-partial-and-clean-merges-mm8o52wi/download' --output '.skill-downloads/git-partial-and-clean-merges-mm8o52wi/SKILL.md.part' && mv '.skill-downloads/git-partial-and-clean-merges-mm8o52wi/SKILL.md.part' '.skill-downloads/git-partial-and-clean-merges-mm8o52wi/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/git-partial-and-clean-merges-mm8o52wi/SKILL.md' && test -s '.skill-downloads/git-partial-and-clean-merges-mm8o52wi/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/dev-swarm-git-merge' && cp -R '.skill-downloads/git-partial-and-clean-merges-mm8o52wi' '.claude/skills/dev-swarm-git-merge'Cursor
test -f '.skill-downloads/git-partial-and-clean-merges-mm8o52wi/SKILL.md' && test -s '.skill-downloads/git-partial-and-clean-merges-mm8o52wi/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/dev-swarm-git-merge' && cp -R '.skill-downloads/git-partial-and-clean-merges-mm8o52wi' '.cursor/skills/dev-swarm-git-merge'Codex
test -f '.skill-downloads/git-partial-and-clean-merges-mm8o52wi/SKILL.md' && test -s '.skill-downloads/git-partial-and-clean-merges-mm8o52wi/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/dev-swarm-git-merge' && cp -R '.skill-downloads/git-partial-and-clean-merges-mm8o52wi' '.agents/skills/dev-swarm-git-merge'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/git-partial-and-clean-merges-mm8o52wi'openskills read 'git-partial-and-clean-merges-mm8o52wi'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/git-partial-and-clean-merges-mm8o52wi/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
Configure a Chat Channel with SecretRefs
DevOps
Set up chat channels using non-interactive commands, with secrets only as SecretRefs. Covers gather, mutate, repair, and prove steps for reliable delivery.
Investigate ClickHouse CI Failures
DevOps
Investigate a ClickHouse CI failure end-to-end from a PR or S3 report URL. Fetches failed tests, classifies flaky vs real regression, and checks for existing issues/fixes.
Ansible PR Review
DevOps
Reviews an Ansible PR following the project's standardized process, including changelog checks, test coverage validation, and feedback tracking.