Skip to content

Delete empty folders (for git) command #17

@chrisyarbrough

Description

@chrisyarbrough

This might be stretching the envelope of a launcher a little, but Unity users who use git, face a specific issue:

  • git doesn't track folders, only files.
  • Unity tracks folders via .meta files.
  • If git removes all files in a folder, and the folder meta file (e.g. during branch switch), it will leave an empty folder behind. Unity will then generate a new meta file for this folder, causing version control noise.

The git clean command can be used to remove untracked folders, however, it may remove unwanted things like build artifacts, or depending on the settings it could remove things on the gitignore, like the Unity Library.
Also, git clean only works in the current directory, which forces users to usually cd to the repo root etc.

Our own clean command would be Unity-specific and only remove folders inside of the Assets/Packages directories and work from anywhere in the project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions