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

fix: ensure wrangler init works with older versions of git #1209

Merged
merged 1 commit into from
Jun 9, 2022

Conversation

petebacondarwin
Copy link
Contributor

Rather than using the recently added --initial-branch option, we now just renamed the initial branch using git branch -m main.

Fixes #1168

Rather than using the recently added `--initial-branch` option, we now just renamed the initial branch using `git branch -m main`.

Fixes cloudflare#1168
@changeset-bot
Copy link

changeset-bot bot commented Jun 9, 2022

🦋 Changeset detected

Latest commit: 818c493

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
wrangler Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Jun 9, 2022

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.developers.workers.dev/runs/2466751189/npm-package-wrangler-1209

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.developers.workers.dev/prs/1209/npm-package-wrangler-1209

Or you can use npx with this latest build directly:

npx https://prerelease-registry.developers.workers.dev/runs/2466751189/npm-package-wrangler-1209 dev path/to/script.js

Copy link
Contributor

@threepointone threepointone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to land this, just a question, fee free to take a call

await execa("git", ["init"], {
cwd: creationDirectory,
});
await execa("git", ["branch", "-m", "main"], {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this make 2 branches in every project? Do you think we should do this only as a fallback?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I don't know git lol, does this do a rename?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This command simply renames the current branch (e.g. master) to main.

@petebacondarwin petebacondarwin merged commit 2d42882 into cloudflare:main Jun 9, 2022
@petebacondarwin petebacondarwin deleted the old-git branch June 9, 2022 07:55
@github-actions github-actions bot mentioned this pull request Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 BUG:Tries to init with main branch but fails on older git versions
2 participants