Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

git clean -d deletes files in junctioned directories on windows #81

Closed
@jdebbink

Description

@jdebbink

When I create a junction to a directory within a git repository and run git clean -d, the underlying files in the directory being pointed to by the junction gets deleted.

To reproduce:

  1. Using git bash, create a folder with a file that will later be a junction in a git repository.
mkdir afolder echo "some text" > afile.txt
  1. Using git bash, create a repository
    git init arepo

  2. Using windows command prompt, navigate to the repository and create a junction to the folder created in step 1.
    mklink /J C:\arepo\junctionfolder C:\afolder

  3. Run git clean
    git clean -df

The file created in step 1 has been deleted. Should git clean -d stop when it encounters a junctioned directory and only delete the junction and not all the files in the junction?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions