Skip to content
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:Tries to init with main branch but fails on older git versions #1168

Closed
polybuildr opened this issue Jun 2, 2022 · 1 comment · Fixed by #1209 or #1193
Closed

🐛 BUG:Tries to init with main branch but fails on older git versions #1168

polybuildr opened this issue Jun 2, 2022 · 1 comment · Fixed by #1209 or #1193
Assignees
Labels
bug Something that isn't working

Comments

@polybuildr
Copy link

polybuildr commented Jun 2, 2022

Hello! 👋

Wrangler version: 2.0.7
OS: Linux/Ubuntu

I just tried my first wrangler init and it asked me if I wanted to use git to manage this Worker. I said yes but unfortunately the command failed because it did a git init --initial-branch=main and that's not a valid option for my git version of 2.25. Based on this StackOverflow answer, the option was only added in v2.28.

I'll look into updating my git version, but maybe wrangler can avoid using this option for older git versions? If you'd like to still call the branch main with older git versions, maybe that can be achieved with a git branch -m?

@polybuildr polybuildr changed the title Tries to init with main branch but fails on older git versions 🐛 BUG:Tries to init with main branch but fails on older git versions Jun 2, 2022
@petebacondarwin petebacondarwin moved this to Untriaged in workers-sdk Jun 2, 2022
@petebacondarwin
Copy link
Contributor

Looking into this git branch -m, which renames the current branch seems like a very reasonable backward compatible way to achieve this.

@petebacondarwin petebacondarwin moved this from Untriaged to Backlog in workers-sdk Jun 2, 2022
@petebacondarwin petebacondarwin self-assigned this Jun 9, 2022
petebacondarwin added a commit to petebacondarwin/wrangler2 that referenced this issue Jun 9, 2022
Rather than using the recently added `--initial-branch` option, we now just renamed the initial branch using `git branch -m main`.

Fixes cloudflare#1168
@petebacondarwin petebacondarwin moved this from Backlog to In Review in workers-sdk Jun 9, 2022
@petebacondarwin petebacondarwin added the bug Something that isn't working label Jun 9, 2022
petebacondarwin added a commit that referenced this issue Jun 9, 2022
Rather than using the recently added `--initial-branch` option, we now just renamed the initial branch using `git branch -m main`.

Fixes #1168
Repository owner moved this from In Review to Done in workers-sdk Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working
Projects
None yet
2 participants