Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error: invalid path 'filePath:Zone.Identifier'

Tags:

git

If I try to check out the development branch, I am getting this error:

$ git checkout development
error: invalid path 'src/assets/svg-icon/exit.svg:Zone.Identifier'

Can anyone tell me why I am getting this? I am using windows-10.

like image 389
Arif Avatar asked Apr 15 '26 18:04

Arif


2 Answers

I faced same issue while cloning the project. Resolved this issue by understanding why this happened with help of this page https://github.com/git-for-windows/git/issues/2777

then run this command to set the flag

git config core.protectNTFS false

Above command require Admin permission to update flag

To run this command as administrator open terminal(cmd prompt) as admin and run below mentioned command

git config --system core.protectNTFS false

For more detailed information you can go through this page

github/git Checkout Returns 'error: invalid path' on Windows

like image 61
Rohit Kumar Avatar answered Apr 18 '26 06:04

Rohit Kumar


Issue 2777 does add:

this is indeed an invalid path.

The :Zone.Identifier suffix is a so-called "Alternate Data Stream" (see e.g. this blog post for more information) that is attached to the file in question, and it is not supposed to be committed, and it is certainly not supposed to be checked out.

You need to remove this before checking out (e.g. by cloning with --no-checkout and then playing games with the Git index all while operating under core.protectNTFS=false).

The blog post: "Hidden in plain sight: Alternate Data Streams" from David Hamann.

like image 26
VonC Avatar answered Apr 18 '26 08:04

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!