create-branch

Creates a new git feature branch based on origin/main with fork-friendly tracking setup.

8|7|Updated Feb 14, 2023
One-click install
npx skills add https://github.com/eclipse-slm/slm --skill create-branch-eclipse-slm
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: create-branch
Source: https://github.com/eclipse-slm/slm/tree/main/.agents/skills/create-branch
Command: npx skills add https://github.com/eclipse-slm/slm --skill create-branch-eclipse-slm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Starting new work on a clean, up-to-date branch is error-prone: developers forget to fetch the latest origin/main, base branches off stale commits, or misconfigure upstream tracking in fork-based workflows. This Skill standardizes the entire branch creation process. ## Core Features & Use Cases - State Verification: Checks for uncommitted changes before branching and offers options to commit, stash, discard, or continue. - Convention-Based Naming: Suggests branch name patterns such as feature/<name>, bugfix/<name>, issue/<number>, and deprecation/<name>. - Fork-Friendly Setup: Bases the branch on origin/main and unsets upstream tracking so the first push targets a personal fork remote. - Use Case: A developer starting a bug fix asks to create a branch; the Skill fetches origin, creates bugfix/login-timeout from origin/main, unsets upstream, and prints next steps for committing and pushing. ## Quick Start Ask the assistant to create a new branch for your task, for example by saying "create a branch for fixing the login timeout bug".

Frequently Asked Questions about create-branch

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

FAQPage Schema
How do I create a new git branch based on origin/main?▼

Fetch the latest remote state with git fetch origin, then run git checkout -b <branch-name> origin/main. This guarantees the new branch starts from the most recent upstream main commit rather than a stale local copy.

What are good git branch naming conventions?▼

Use a category prefix separated by a slash, such as feature/<name>, bugfix/<name>, issue/<number>, or docs/<topic>. Keep names lowercase, use hyphens within names, and stay under 50 characters for readability.

Why unset upstream tracking after creating a branch?▼

In fork-based workflows, new branches are pushed to a personal fork remote, not origin. Unsetting upstream prevents accidental pushes to the wrong remote; the correct tracking is set on first push with git push -u <fork-remote> <branch-name>.

What should I do with uncommitted changes before creating a branch?▼

You can commit them first, stash them for later, discard them if they are no longer needed, or carry them onto the new branch. Committing completed work first is usually the safest option.

When should I not create a new branch?▼

Skip branch creation if you are already on a feature branch ready for work, or if you only need information about naming conventions. Creating a branch is only needed when starting new work that should not happen on main.