Skip to content

Start-PSBuild -Clean will remove untracked files without prompt or warning #10021

@KirkMunro

Description

@KirkMunro

Steps to reproduce

  1. Add some .cs files with things you are working on that don't happen to be tracked yet.
  2. Invoke Start-PSBuild -Clean to kick off a clean build process.
  3. Your untracked files are deleted without warning or prompt, and they don't even go into your recycle bin.

Expected behavior

Start-PSBuild -Clean should not delete untracked source files without prompt by default (which git clean does). That is a really poor decision. I just lost a good chunk of work because of that behaviour, and now I'm losing time trying to get it back. All I wanted was a clean build (i.e. remove any temporary build files, and then rebuild). I did not want to remove files I happen to have in my file system that may be important to me.

Actual behavior

Any untracked files you have are removed without warning and without even going to the recycle bin.

Environment data

Irrelevant, but I happen to be invoking Start-PSBuild in Windows PowerShell 5.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-Maintainers-Buildspecific to affecting the buildIssue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-FixedThe issue is fixed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions