-
Notifications
You must be signed in to change notification settings - Fork 735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 BUG: Initializing project with git fails #1228
Comments
Thanks for the issue report @cobyge - this is really strange since it is saying that it cannot find the |
I have read over the internet that I was wondering instead of moving/renaming the branch by default ( here we are also making assumption that branch is not named as main by default) why don't we tell to create branch main by default when initializing the repo So instead of await execa("git", ["init"], {
cwd: creationDirectory,
}); why dont we use await execa("git", ["init" ,"-b","main"], {
cwd: creationDirectory,
}); and get rid of await execa("git", ["branch", "-m", "main"], {
cwd: creationDirectory,
}); |
We recently moved away from From what I read, as long as we create an initial commit then we would be safe to rename the branch. |
Okay got it.So the idea would be to commit the initial files that get generated like |
… init` Sometimes git is unable to rename a branch if it has no commits on it. So we now create an empty commit just before renaming. Fixes cloudflare#1228
… init` Sometimes git is unable to rename a branch if it has no commits on it. So we now create an empty commit just before renaming. Fixes cloudflare#1228
If `git` does not support the `--initial-branch` argument then just fallback to the default initial branch name. We tried to be more clever about this but there are two many weird corner cases with different git versions on different architectures. Now we do our best, with recent versions of git, to ensure that the branch is called `main` but otherwise just make sure we don't crash. Fixes cloudflare#1228
If `git` does not support the `--initial-branch` argument then just fallback to the default initial branch name. We tried to be more clever about this but there are two many weird corner cases with different git versions on different architectures. Now we do our best, with recent versions of git, to ensure that the branch is called `main` but otherwise just make sure we don't crash. Fixes cloudflare#1228
If `git` does not support the `--initial-branch` argument then just fallback to the default initial branch name. We tried to be more clever about this but there are two many weird corner cases with different git versions on different architectures. Now we do our best, with recent versions of git, to ensure that the branch is called `main` but otherwise just make sure we don't crash. Fixes #1228
What version of
Wrangler
are you using?2.0.9
What operating system are you using?
WSL Ubuntu 20.04.4
Describe the Bug
When I try to create a new project with git initialization, I get an error as show below.
Git version 2.25.1 (Latest for Ubuntu 20.04.4)
The text was updated successfully, but these errors were encountered: