agentleFS
ogromwangogromwang/skills/git-merge/SKILL.md

git-merge

Skill3 starsChanged 11 months agoMITView on GitHub

Safely merge current branch into target branch and return. Use when user wants to merge current branch to another branch, mentions "merge A to B", "merge my branch into", or similar merge requests. Ensures current changes are committed before merging, switches to target branch, performs merge, then switches back.

4 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions4 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 4

    1. aws-solutions/konductor★ 9same name
    2. Cogni-AI-OU/cogni-ai-agent-skills★ 4same name
    3. MithunWijayasiri/dotclaude★ 4same name
    4. mantaray0/crew★ 1same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository3 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    ALWAYS use the script: - do NOT use manual git commands:

    line 20
  2. Distinctive:

    Always returns to original branch (even if push fails)

    line 42

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Git Merge Workflow

Safely merge the current branch into a target branch and return to the original branch.

When to Use

Automatically activate when the user:

  • Explicitly asks to merge branches ("merge A to B", "merge my branch into")
  • Mentions combining changes from current branch to another ("merge into main", "merge to develop")
  • Asks to "push my changes to [branch]" but means merging
  • Says phrases like "merge this feature to main" or "combine my branch with develop"

Workflow

ALWAYS use the script - do NOT use manual git commands:

bash skills/git-merge/scripts/safe_merge.sh [--push] <target-branch>

Options:

  • --push 合并后自动推送到远程分支

Examples:

bash skills/git-merge/scripts/safe_merge.sh main
bash skills/git-merge/scripts/safe_merge.sh develop
bash skills/git-merge/scripts/safe_merge.sh --push main

Safety Guarantees

  1. Checks for uncommitted changes and warns user
  2. Stashes uncommitted changes if requested
  3. Verifies target branch exists
  4. Performs merge with clear output
  5. Always returns to original branch (even if push fails)
  6. Reports merge status clearly
  7. Optional --push flag for automated remote push

Script Details

The script handles:

  • Detecting current branch
  • Checking for uncommitted changes
  • Stashing changes if needed
  • Switching to target branch
  • Merging current branch into target
  • Returning to original branch
  • Restoring stashed changes if applicable
  • Clear status reporting

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.