-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Git fails to innitialize with create t3-app #96
Comments
Unable to replicate. Is this happening every time you use the CLI? Have you tried using a different package manager? |
Hello @nexxeln, |
Maybe it's something OS specific. As far as I know, zorin is based on ubuntu. I'm also using ubuntu in WSL and works fine for me. |
@nexxeln Okay just wanted to let you know about it. It is not detrimental to the creation of the app and someone can manually initialize git themselves. It's an awesome project 👍 |
Maybe try updating git? |
Found the issue, for initialising git we use
This is a new feature released in git 2.28 https://github.blog/2020-07-27-highlights-from-git-2-28/#introducing-init-defaultbranch Working on a fix right now |
revert back? |
Is commit d2e4d87 considered a "fix" so we can close this? Or should we make it work for older git versions too? |
i don't think forcing people to update git to use the cli is a good thing to do though.. |
I think this was discussed in the server right? that we can just initialise the repository with |
That had the side-effect of leaving behind an unused branch. Wouldn't something like: const { stdout: gitVersion } = await execa("git --version");
// e.g. gitVersion = "git version 2.32.0 (Apple Git-132)"
const asNumber = ...; // parse the output
if (asNumber >= 2.28) {
await execa("git init --initial-branch=main", { cwd: projectDir });
} else {
await execa("git init", { cwd: projectDir });
await execa("git checkout -b main", { cwd: projectDir }); // maybe?
} be better? |
Yeah. I think that's a better approach, leave an extra branch depending on the git version |
Leaving for work but I can have a PR out tonight. Is the |
Yep, just checked the documentation, pretty sure it's the same command and the same response on every OS I'm not sure about different versions though, maybe in an old version it was different? But this can just be YOLO'd and fixed as more users report issues |
this would be a better approach i think 👍🏼 |
Got the same problem still with
Worked with |
Describe the bug
When I run the create
yarn create t3-app
After choosing my preferred options, the scaffold builds successfully, however during the build, it attempts to initialise git and it fails.
Git can be initialised manually later by running
git init
after the buildTo Reproduce
Steps to reproduce the behaviour:
✖ Failed: could not initialise git
Expected behaviour
The git initialisation should not fail
Additional information
Screenshots
The text was updated successfully, but these errors were encountered: