Skip to content

fix(commit-commands): use valid git flag -b instead of --branch#42505

Open
mySebbe wants to merge 1 commit intoanthropics:mainfrom
mySebbe:fix/commit-push-pr-checkout-flag
Open

fix(commit-commands): use valid git flag -b instead of --branch#42505
mySebbe wants to merge 1 commit intoanthropics:mainfrom
mySebbe:fix/commit-push-pr-checkout-flag

Conversation

@mySebbe
Copy link
Copy Markdown

@mySebbe mySebbe commented Apr 2, 2026

Summary

  • git checkout --branch is not a valid git command — git errors with unknown option 'branch'
  • The correct flag for creating a new branch is -b (there is no long-form --branch)
  • This prevented /commit-push-pr step 1 ("Create a new branch if on main") from working, as git checkout -b <name> would never match the Bash(git checkout --branch:*) allowed-tools pattern

Fixed in both locations:

  • .claude/commands/commit-push-pr.md
  • plugins/commit-commands/commands/commit-push-pr.md

Reproduction

$ git checkout --branch test
error: unknown option `branch'
usage: git checkout [<options>] <branch>
   ...
    -b <branch>           create and checkout a new branch

Test plan

  • Verified git checkout --branch fails with "unknown option" error
  • Verified git checkout -b is the correct flag (confirmed via git checkout --help)
  • Updated both command file locations

🤖 Generated with Claude Code

`git checkout --branch` is not a valid git command — git errors with
"unknown option 'branch'". The correct flag for creating a new branch
is `-b`. This prevented `/commit-push-pr` step 1 ("Create a new branch
if on main") from working, as the allowed-tools pattern would never
match a valid `git checkout -b` call.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant