ptp-master

Returns the working tree to an up-to-date master branch via gated git switch and fast-forward pull.

Updated Jun 8, 2026
One-click install
npx skills add https://github.com/AlmogMaayan/ptp --skill ptp-master-almogmaayan
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ptp-master
Source: https://github.com/AlmogMaayan/ptp/tree/main/skills/ptp-master
Command: npx skills add https://github.com/AlmogMaayan/ptp --skill ptp-master-almogmaayan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? After finishing work on a feature branch, developers need a safe way to return to master without losing uncommitted changes or accidentally creating merge commits. This skill automates that return while refusing to touch a dirty working tree. ## Core Features & Use Cases - Clean-tree gate: Runs git status --porcelain --untracked-files=all first and stops with a full report if any staged, unstaged, or untracked changes exist, so dirty work is never relocated or lost. - Safe switch and pull: Executes git switch master (leveraging git's DWIM to bootstrap master from a remote if needed) followed by git pull --ff-only, which can never create a merge commit. - Explicit failure reporting: On switch failure, diverged branches, or missing upstream, it stops and reports the exact error rather than attempting merges, rebases, or stashes. - Use Case: After archiving a completed ptp feature branch, invoke this skill to land back on a fast-forwarded master, confident that any uncommitted work would have blocked the operation instead of being stashed or overwritten. ## Quick Start Ask the assistant to return to an up-to-date master branch using the ptp-master skill, confirming the working tree is clean first.

Frequently Asked Questions about ptp-master

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely switch back to the master branch in git?▼

Check that the working tree is clean with git status --porcelain, then run git switch master followed by git pull --ff-only. This skill automates exactly that sequence and stops immediately if any uncommitted or untracked changes exist.

How to update master without creating a merge commit?▼

Use git pull --ff-only, which only fast-forwards the local branch to its upstream and fails instead of merging when histories have diverged. This skill always uses --ff-only and never falls back to a plain pull, merge, or rebase.

What happens if my working tree is dirty when switching branches?▼

The skill stops before running any git mutation. It prints the full porcelain output, recommends committing or stashing first, and makes no switch or pull, so uncommitted work is never relocated or lost.

Does git switch master work if no local master branch exists?▼

Yes, git's DWIM behavior creates a local master tracking a matching remote branch such as origin/master when no local master exists. If neither exists, the switch fails and the skill reports the error without attempting a pull.

Why does git pull --ff-only fail on a diverged master?▼

A fast-forward is impossible when local and remote master histories have diverged, so --ff-only exits non-zero rather than merging. The skill reports the failure and leaves reconciliation to the user, never auto-merging or rebasing.