-
Notifications
You must be signed in to change notification settings - Fork 525
Description
Operating System
Linux (Docker container)
Run Mode
Docker
App Version
v0.14.0rc (bug also exists in v0.13.0)
Bug Description
When Automaker initializes a new project, it uses git init without specifying the initial branch name. This causes new projects to default to "master" instead of "main", which conflicts with GitHub's current standard (since 2020) and causes feature visibility issues when pushing to GitHub.
Root Cause Analysis
File: apps/server/src/routes/worktree/routes/init-git.ts:47
// Initialize git and create an initial empty commit
await execAsync(`git init && git commit --allow-empty -m "Initial commit"`, {
cwd: projectPath,
});The git init command relies on the system's default branch configuration. Even though the Docker container may have init.defaultBranch=main configured globally, it's better to be explicit to ensure consistent behavior across all environments.
Impact
- All features inherit wrong branch: When features are created, they get
branchName: "master"in theirfeature.jsonfiles - GitHub push creates mismatch: When pushing to GitHub (which defaults to "main"), there's a branch name mismatch
- Features disappear from UI: The Kanban board filters features by branch name, so features with
branchName: "master"become invisible when the actual branch is "main" - Manual fix required: Users must manually update all
feature.jsonfiles to change branchName from "master" to "main"
Steps to Reproduce
- Create a new project in Automaker
- Run
git branchin the project directory → shows "master" - Create several features through Automaker UI
- Check
.automaker/features/*/feature.json→ all have"branchName": "master" - Push to GitHub → GitHub creates "main" branch (GitHub default since 2020)
- Return to Automaker UI → all features have disappeared from Kanban board
- Check browser console → features are being filtered because branchName doesn't match current branch
Expected Behavior
- New projects should be initialized on "main" branch to match modern GitHub standards
- Features should automatically get
branchName: "main" - No manual intervention required when pushing to GitHub
Suggested Fix
Update apps/server/src/routes/worktree/routes/init-git.ts:47 to explicitly specify the initial branch:
// Initialize git and create an initial empty commit
await execAsync(`git init --initial-branch=main && git commit --allow-empty -m "Initial commit"`, {
cwd: projectPath,
});The --initial-branch flag is supported in Git 2.28+ (July 2020), which should be available in all modern environments.
Additional Context
This issue affects all new projects created with Automaker. GitHub changed its default branch from "master" to "main" in October 2020, and most Git hosting platforms have followed suit. Automaker should align with this industry standard.
Related: Issue #735 proposes adding a feature migration tool when users rename git branches manually.