user3686652
user3686652

Reputation: 815

How to delete a git local repo folder in windows 7

I have created git clone in local directory. Then I have run npm and also installed some node packages(gulp etc). But I don’t want now the working directory. So I just did right click mouse and delete, I am not able to delete. I am getting the below error.

"The source file name(s) are larger than is supported by the file system. Try moving to a location which has shorter path name, or try renaming to shorted name(s) before attempting this operation"

What would be the issue.

Upvotes: 1

Views: 281

Answers (1)

VonC
VonC

Reputation: 1324937

On Windows, this thread shows that it can be:

  • a path length issue (the path is too long)
  • a process issue (which keeps an handle on one of the files being deleted)

I found out make a drive mapping about halfway into the folder structure you should be able to delete the latter half of the file heirarcy.

For example if you are getting the error trying to delete:

\\NAS.Device.Company.com\a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z

Then map a network drive Z: to

\\NAS.Device.Company.com\a\b\c\d\e\f\g\h\i\j\k\

This will reduce the file herarchy down to a smaller path.
Open explorer and view the Z: drive. It should contain a folder called L (in this example).

You should now be able to delete the L and its subfolders without an issue, thereby deleting half the folder hierarchy.
After that, disconnect the Z: drive and try to delete whatever is left normally.
Problem solved!

Upvotes: 1

Related Questions