Skip to content
This repository has been archived by the owner on Apr 24, 2022. It is now read-only.

Tracked file are being deleted when running "git clean -xdf" in "yarn workspaces"

License

Notifications You must be signed in to change notification settings

Shmulik-Kravitz/yarn-with-git-bug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tracked file are being deleted when running "git clean -xdf" in "yarn workspaces"

When running git clean -xdf in a repo with yarn workspaces, the contents of the workspaces are deleted.

Consider this folder structure:

  • workspace1
    • index.js
    • package.json
  • workspace2
    • index.js
    • package.json
  • .gitignore
  • README.md
  • package.json
  • yarn.lock

After running git clean -xfd the files in bold (tracked source controlled files) are deleted! Even though clean shouldn't have impacted tracked files at all.

I believe yarn workspaces bug. I've opened an issue @yarn: yarnpkg/yarn#7536

How to reproduce

  1. Clone the repo.
  2. Run yarn in the root folder or in one of the workspaces.
  3. Run git clean -xdf

The contents of the workspaces are deleted.

About

Tracked file are being deleted when running "git clean -xdf" in "yarn workspaces"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published