Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: skip .git when emptying dir #9659

Merged
merged 1 commit into from
Aug 13, 2022
Merged

Conversation

btea
Copy link
Collaborator

@btea btea commented Aug 13, 2022

Description

When creating a project with create-vite, I think .git should be ignored if overwriting what's under the current folder.

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@Shinigami92 Shinigami92 changed the title chore: skip .git when emptying dir feat: skip .git when emptying dir Aug 13, 2022
@Shinigami92 Shinigami92 added enhancement New feature or request p2-nice-to-have Not breaking anything but nice to have (priority) labels Aug 13, 2022
Copy link
Member

@patak-dev patak-dev left a comment

Choose a reason for hiding this comment

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

I think this is a good feature 👍🏼

@patak-dev patak-dev merged commit 07fe65e into vitejs:main Aug 13, 2022
@btea btea deleted the chore/ignore-git branch August 13, 2022 12:11
@lantos1618
Copy link

lantos1618 commented Aug 15, 2022

Is this feature live?
I legit just lost 8+ hours work...

I wanted to test something out, thought it would take me 30 minutes. I got in the into the groove and continued to work, created a git and made branches. Created a new branch to add a frontend, ran pnpm create vite@latest . and stepped through all the prompts. Vite overwrote and removed some files/folders which was expected. Went to git check out and the whole .git folder was deleted.

I'm left with the question why does a script even remove a .git folder anyways?

Anyways if you're reading this MOTS, don't just rely on git anything can happen. Don't be dumb like me push it to a remote...
:<

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants