Skip to content

feat(cli): add --git-branch flag to branches create command#5250

Open
avallete wants to merge 3 commits into
developfrom
claude/add-git-branch-option-JZJjz
Open

feat(cli): add --git-branch flag to branches create command#5250
avallete wants to merge 3 commits into
developfrom
claude/add-git-branch-option-JZJjz

Conversation

@avallete
Copy link
Copy Markdown
Member

@avallete avallete commented May 14, 2026

Adds support for explicitly specifying a git branch to associate with a new preview branch via the --git-branch flag in the supabase branches create command.

Changes

  • TypeScript CLI (next): Added gitBranch flag to the create command config with optional string value. The flag prefers explicitly provided values over auto-detected git branches from environment variables.
  • TypeScript CLI (legacy): Added gitBranch flag to the legacy branches create command for backward compatibility.
  • Go CLI: Added --git-branch flag support to the branches create command, respecting explicit values over auto-detected branches.
  • API integration: Updated the branch creation API request to include the git_branch field when provided.
  • Documentation: Updated SIDE_EFFECTS.md to reflect the new git_branch parameter in the API request body and added the flag to the documented command flags.
  • Tests: Added integration test coverage for the new flag and verified that explicit --git-branch values take precedence over auto-detected branches.

Implementation Details

The implementation follows a preference hierarchy: explicitly provided --git-branch flag values take precedence over auto-detected git branches (from GITHUB_HEAD_REF or local git state). This allows users to override auto-detection when needed while maintaining backward compatibility for existing workflows that rely on auto-detection.

https://claude.ai/code/session_01Vsgo83p6eooc7QUXuZXJVx

Closes: CLI-1465

claude added 2 commits May 14, 2026 14:33
Exposes the v1 API's git_branch field on `supabase branches create` in
the next shell. When provided, it overrides the git branch detected
from the local environment so users can explicitly associate a git
branch independent of the new branch's name.
Adds a --git-branch flag on `supabase branches create` in the Go CLI
and forwards it through the legacy TS proxy. When provided, the flag
takes precedence over the git branch auto-detected from the local
working directory.
@avallete avallete requested a review from a team as a code owner May 14, 2026 15:09
@coveralls
Copy link
Copy Markdown

coveralls commented May 14, 2026

Coverage Report for CI Build 25868642509

Warning

No base build found for commit 62b57b5 on develop.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 63.738%

Details

  • Patch coverage: No coverable lines changed in this PR.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 15686
Covered Lines: 9998
Line Coverage: 63.74%
Coverage Strength: 7.06 hits per line

💛 - Coveralls

Copy link
Copy Markdown
Member Author

@avallete avallete left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants