Repository navigation
Start new projects on a Git main branch - #336
Merged
Merged
Conversation
widefleet init now creates the project's Git repository on branch main, unless the project lies inside an existing repository or Git is missing. A later plain git init keeps main instead of creating master, so deploy no longer stops at the branch check. When the checkout has no local main, the deploy branch error suggests renaming the branch instead of switching to one that does not exist.
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
widefleet-docs | 7c3bf2f | Nov 23 2026, 01:05 PM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
widefleet initdid not create a Git repository. A plaingit initafterwards names the first branchmasterunlessinit.defaultBranchis configured (Git 2.53 still does).widefleet deploysaves the main app's source from the local branchmain, so it then asks for confirmation in a terminal and fails without one, for example in CI or an agent shell:There is no
mainto switch to in that repository, so the hint does not help either.What changes
init(crates/platform-cli/src/installation.rs) runsgit init --initial-branch=mainin the new project, without a commit. A latergit initonly reinitializes it and keepsmain.initstill creates the project, and deploy initializes the repository as before.crates/platform-cli/src/source.rs): when the checkout has no local branchmain, the error suggestsgit branch -m maininstead of switching branches.Tests
initstarts a repository onmain, and does not nest one inside an existing repository.cli.test.ts: the branch mismatch test checks the rename hint.cargo clippy -p platform-cli --all-targets -D warnings,cargo test -p platform-cli(63 passed) andRUN_CLI_TESTS=1 vitest run apps/control-plane/tests/cli.test.ts(61 passed).init my-appprintsInitialized a Git repository on branch main, a followinggit initkeepsmain, andinitinside an existing repository creates no.git.Documentation: #337 (draft until a CLI release includes this change).


Confidence Score: 5/5
The PR appears safe to merge.Summary
New projects start on Git branch
mainwithout an initial commit.mainbranch.mainis missing.No actionable issues were found.
Reviews (1) · Last reviewed commit: "Start new projects on a Git main branch" · Reviewed by Greptile