Git checkout branch
Skill MarcoAntolini/cursor-sync/cursor-skills/git-checkout-branch
Just a repo to sync my cursor skills, rules and commands.
npx -y skills add MarcoAntolini/cursor-sync --skill git-checkout-branchAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Switches to a named branch; creates a new local branch only after explicit confirmation.
SKILL.md
1.3 KB, 312 tokens by cl100k_base, as published. Nobody here has run it
Git checkout / switch branch
branch = name from this message (trimmed). If missing, ask once and stop.
Steps
git status --short. If the working tree is dirty andgit switchwould fail, report and stop — commit/stash/discard only if the user says so in this message.git fetch --allwhen network is allowed (skip and say so if forbidden).- Resolve and switch:
- Local
branchexists →git switch branch - Only on remote →
git switch branchif Git tracks it unambiguously; elsegit switch -c branch --track origin/branch - Neither local nor
origin/branch→ authorization gate (next section)
- Local
- Done when: HEAD is on
branch, or you stopped at a hard stop / unanswered create gate.
Authorization gate (missing branch)
- State that neither local nor
origin/<branch>was found. - Ask whether to create local
branchfrom current HEAD (or from a base the user named). - Create only on a clear yes (
yes/proceed/create it). Otherwise stop. - On confirm:
git switch -c branch(orgit switch -c branch <base>if they named a base).
Guardrails
- No branch delete, force checkout of unrelated SHAs, or inventing names.