4

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.

Arif
  • 6,094
  • 4
  • 49
  • 81

3 Answers3

8

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

Rohit Kumar
  • 87
  • 1
  • 5
3

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.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

For me, it was a useless file. In my workflow file I delete it after building and then everything worked.

jar
  • 2,646
  • 1
  • 22
  • 47