agentsclimarketplace

Git release start

Skill FuDesign2008/open-skills/skills/git-release-start

Use when a version iteration starts and a release branch must be created — handles inconsistent branch-naming conventions across repos, multi-repo synchronized creation, and ensuring local tracking correctly points to origin/release/X.Y.Z rather than the base branch. Works with GitLab, GitHub, and other Git hosting platforms; single-repo or multi-repo. Triggers — 「创建release分支」「开release分支」「开分支」「迭代分支」 / create release branch.From its SKILL.md

Install
npx -y skills add FuDesign2008/open-skills --skill git-release-start

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 6 stars6 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.

SKILL.md

10.9 KB, as published. Nobody here has run it

Git Release Start

Overview

At the start of a version iteration, create a release branch from the main development branch. Core principle: create on remote first, then sync to local — git checkout -b release/X origin/master makes the local branch track origin/master instead of origin/release/X, planting a landmine for later push/pull confusion.

Pairing: git-release-start (iteration start, this skill) ↔ git-release-finish (iteration end, tag + merge).


Platform CLI mapping

PlatformCLI toolCreate branch on remote
GitLab (SaaS / self-hosted)glabglab api POST "projects/:fullpath/repository/branches?branch=<NAME>&ref=<BASE>"
GitHubghgh api repos/:owner/:repo/git/refs -f ref=refs/heads/<NAME> -f sha=<BASE_SHA>

Convention: <GIT_CLI> below stands for the platform's CLI tool — pick the row above that matches your environment, or the equivalent command for other platforms. Core git operations (fetch, checkout) are platform-agnostic.


Use when / Do not use for

Use when:

  • A version iteration starts and a new release branch needs to be created from the main branch
  • Multiple repos need release branches for the same version, created in a coordinated way
  • The branch's tracking must be verified correct (not accidentally pointing at master/main)
  • An existing release-branch naming convention exists and must be followed

Do not use for:

  • Non-Git hosting platforms

Principle: the flow must run end-to-end. No phase can be skipped, regardless of repo count. "It's just creating a branch" is the most common cause of skipping verification and ending up with wrong tracking.

Pre-conditions

  • The corresponding platform CLI is installed and authenticated
  • The version number is confirmed (e.g. 8.2.70)
  • The base branch is confirmed (e.g. master or main)

Phase map

PhaseOperationKey tools
1Confirm version number and base branch—
2Analyze each repo's release-branch naming conventiongit branch -r
3Create the release branch on remote<GIT_CLI> api
4Sync locally + set trackinggit fetch + git checkout --track
5Update environment fileecho / text write
6Verifygit branch + cat
7Output report—

Phase 1: Confirm version number and base branch

⚠️ Confirm before creating, to avoid creating the wrong version or basing off the wrong branch.

1.1 Version number confirmation

If the user's message already states the version number, use it directly without asking again. Otherwise confirm with the user:

  • The new version number (e.g. 8.2.70)
  • The previous version number (used in Phase 2 to compare historical branch naming, e.g. 8.2.60)

Checks:

  • Whether the new version's tag already exists: git ls-remote origin refs/tags/<TAG_PATTERN>
  • Whether the new version's release branch already exists: git ls-remote origin refs/heads/release/<VERSION>
  • If it already exists, abort with an error and ask whether to reuse it or rename

1.2 Base branch confirmation

Which branch should the release branch be created from? Usually the main development branch.

# Confirm the base branch exists and is up to date
git fetch origin <BASE_BRANCH>
git log --oneline origin/<BASE_BRANCH> -3

⚠️ Remote HEAD may point at a deprecated branch: after repo migrations or branch-policy changes, remote HEAD may still point at the old main branch (e.g. master) while the actually active main branch has become main. If the branch remote HEAD points to is hundreds of commits behind another candidate branch, HEAD is stale. Trust merge history (git log --merges | grep "into 'main'") as the source of truth, and confirm with the user if needed.

Output: confirmation table (Phase 1 only confirms version number and base branch; the release branch name is determined after Phase 2's analysis)

RepoVersionBase branch
repo-A8.2.70master

After confirmation, proceed to Phase 2 (analyze release-branch naming convention).


Phase 2: Analyze release-branch naming convention

⚠️ Release-branch naming may not be simply release/X.Y.Z — check history. This phase outputs the final branch name; only after it completes can Phase 3 create the branch.

# List existing release branches
git branch -r | grep "origin/release"

Identification rules

Historical branch patternNaming convention
origin/release/8.2.60, origin/release/8.2.52release/{VERSION}
origin/release/8.2.60-perfrelease/{VERSION}-perf
origin/release/mobile-7.5.720release/mobile-{VERSION} (product prefix)

Multi-product repos: each product line has its own release-branch naming; only create the branch for the current product line this time.

Output: confirmation table

RepoRelease branch nameHistorical example
repo-Arelease/8.2.70release/8.2.60
repo-Brelease/8.2.70-perfrelease/8.2.60-perf

Align with the user on the branch name before executing Phase 3.


Phase 3: Create the release branch on remote

⚠️ Core lesson: must create on remote first, then sync to local. Do not create locally first and push.

Reason: a local branch created with git checkout -b release/X origin/master tracks origin/master instead of origin/release/X, causing confusion in later pushes and pulls.

Run in parallel for all repos:

# GitLab — create the branch on remote via API (`:fullpath` auto-resolves inside the repo directory)
glab api --method POST \
  "projects/:fullpath/repository/branches?branch=<RELEASE_BRANCH>&ref=<BASE_BRANCH>"

# GitHub — `:owner/:repo` auto-resolves when `gh` runs inside the repo directory
BASE_SHA=$(git rev-parse origin/<BASE_BRANCH>)
gh api repos/:owner/:repo/git/refs \
  -f ref="refs/heads/<RELEASE_BRANCH>" \
  -f sha="$BASE_SHA"
# If auto-resolution fails, substitute the actual values manually, e.g.: gh api repos/myorg/myrepo/git/refs ...

Parameters:

  • branch: the full name of the new release branch (including path, e.g. release/8.2.70)
  • ref / sha: which branch to create from (the main development branch)
  • :fullpath: auto-resolved by GitLab; GitHub requires manually substituting :owner/:repo

Phase 4: Sync locally + set tracking

⚠️ Use --track to ensure the local branch tracks origin/<RELEASE_BRANCH>.

Run in parallel for all repos:

git fetch origin <RELEASE_BRANCH>
git checkout -b <RELEASE_BRANCH> --track origin/<RELEASE_BRANCH>

Verify tracking:

git branch -vv | grep '^\*'
# Expected output: * release/8.2.70  <SHA> [origin/release/8.2.70] <commit message>

If [origin/master] appears in the tracking column: the branch was created the wrong way; fix it with git branch -u origin/release/8.2.70.


Phase 5: Update environment file

Some repos need the current branch name recorded in a release-branch file (which CI scripts etc. may read).

echo "<RELEASE_BRANCH>" > release-branch
git add release-branch
git commit -m "chore: update release-branch to <RELEASE_BRANCH>"

Note: if the repo doesn't use a release-branch file (no historical commits for it), skip this step.

# Check whether this file has existing history
git log --oneline -- release-branch | head -3

Phase 6: Verify

Run the following verification for each repo:

# Push channel is clear (no permission errors is enough)
git push --dry-run origin <RELEASE_BRANCH>
# Expected: shows what would be pushed, or "Everything up-to-date"; no "rejected" or permission errors

If any check fails, stop and fix it; only proceed to Phase 7 after confirming.


Phase 7: Output report

Generate a confirmation table:

RepoRemote branchLocal trackingrelease-branchStatus
repo-Aorigin/release/8.2.70[origin/release/8.2.70]release/8.2.70✅
repo-Borigin/release/8.2.70-perf[origin/release/8.2.70-perf]N/A✅

Error handling

ScenarioHandling
Tag already existsAbort with an error; may indicate a duplicate release
Release branch already exists (remote)Ask whether to reuse it (checkout directly) or rename
Base branch doesn't existAbort with an error, ask for the correct base ref
glab api returns 401 / 403Check glab auth status, re-authenticate
Tracking points to the wrong branch ([origin/master])Fix with git branch -u origin/<RELEASE_BRANCH>
A local branch with the same name already existsgit branch -D <NAME> to delete it locally, then checkout again
push --dry-run failsCheck the remote URL and permissions

Common mistakes

❌ Wrong✅ RightConsequence
git checkout -b release/X origin/master then pushCreate on remote via <GIT_CLI> api → fetch → --trackTracking points to origin/master, causing confusion in later pull/push
Create the branch locally first, then push to remoteCreate the branch on remote first, then fetch to localSame as above
Skip Phase 5's check/update of release-branchConfirm and update itCI may read the wrong release-branch value
Assume all repos use the same namingCheck historical branch names per repoSome repos' branch names carry special suffixes (e.g. -perf) and get missed
Consider the task done without verifying trackingVerify each item in Phase 6Wrong tracking only surfaces later, during merge/push

Quick reference commands

# List existing release branches
git branch -r | grep "origin/release"

# GitLab — create on remote
glab api --method POST "projects/:fullpath/repository/branches?branch=<NAME>&ref=<BASE>"

# GitHub — create on remote
gh api repos/<OWNER>/<REPO>/git/refs -f ref="refs/heads/<NAME>" -f sha="$(git rev-parse origin/<BASE>)"

# Sync locally
git fetch origin <NAME>
git checkout -b <NAME> --track origin/<NAME>

# Fix tracking (if pointed wrong)
git branch -u origin/<NAME>

# Update release-branch
echo "<NAME>" > release-branch

# Verify
git branch --show-current
git branch -vv | grep '^\*'
git ls-remote origin refs/heads/<NAME>
git push --dry-run origin <NAME>

Keep looking

Skills are one crate of 627,801. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.