Skip to content

feat: skip .git when emptying dir#9659

Merged
patak-cat merged 1 commit intovitejs:mainfrom
btea:chore/ignore-git
Aug 13, 2022
Merged

feat: skip .git when emptying dir#9659
patak-cat merged 1 commit intovitejs:mainfrom
btea:chore/ignore-git

Conversation

@btea
Copy link
Copy Markdown
Contributor

@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
Copy Markdown
Member

@patak-cat patak-cat 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-cat patak-cat 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
Copy Markdown

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...
:<

Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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