Skip to content

create-react-router aborts scaffolding when the optional initial Git commit fails #15735

Description

@chbaefront

Reproduction

Description

When create-react-router initializes Git, it runs:

  1. git init
  2. git add .
  3. git commit -m "Initial commit from create-react-router"

These commands are handled as one operation. If the optional initial commit fails, for example because user.name and user.email are not configured, the CLI reports:

Oh no! Failed to initialize git.

and exits with an error.

At that point, the project files, .git directory, and staged files already exist. Only the initial commit has failed.

System Info

System:
    OS: Windows 11 10.0.26300
    CPU: (16) x64 AMD Ryzen 7 7700 8-Core Processor
    Memory: 39.96 GB / 63.16 GB
  Binaries:
    Node: 22.14.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 4.18.1 - C:\Users\zero86\AppData\Local\vite-plus\bin\yarn.EXE
    npm: 11.6.4 - C:\Program Files\nodejs\npm.CMD
    pnpm: 12.6.0 - C:\Users\zero86\AppData\Local\vite-plus\bin\pnpm.EXE
    bun: 1.4.4 - C:\Users\zero86\AppData\Local\vite-plus\bin\bun.EXE
  Browsers:
    Chrome: 156.0.8078.80
    Edge: Chromium (152.0.4191.53)

Used Package Manager

pnpm

Expected Behavior

Project scaffolding should complete when git init and git add succeed, even if the optional initial commit fails.

The CLI should report that Git was initialized but the initial commit could not be created, ideally with guidance to configure user.name and user.email.

Actual Behavior

The CLI reports Oh no! Failed to initialize git. and exits unsuccessfully, even though the repository was initialized and files were staged.

Activity

  1. chbaefront commented on Nov 5, 2026

    @chbaefront
    Author

    Someone hijacked my issue and opened a PR first. 🤣🤣

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions