Skip to content

Add "*:Zone.Identifier" to Windows .gitignore template to ignore Zone.Identifier ADS #675

@kjanat

Description

@kjanat

Summary
When files downloaded on Windows are copied into WSL, Windows "Zone.Identifier" alternate data streams can appear as separate files (filename:Zone.Identifier) in the repository and show up in git status. The Windows .gitignore template should include an entry to ignore these so they are not accidentally committed.

Problem

  • Files downloaded from the web get a Zone.Identifier ADS on NTFS.
  • When those files are copied into WSL (usually occurs when copying through windows explorer), the ADS can surface as separate files named like "example.txt:Zone.Identifier".
  • These files are currently not ignored by the Windows template, so they appear in git status and can be accidentally added/committed.

Suggested change
Add an ignore pattern to the Windows template to cover Zone.Identifier ADS, e.g.:

# Windows alternate data streams created for downloaded files (Zone.Identifier)
*:Zone.Identifier
Current windows template

# Created by https://www.toptal.com/developers/gitignore/api/windows
# Edit at https://www.toptal.com/developers/gitignore?templates=windows

### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

# End of https://www.toptal.com/developers/gitignore/api/windows

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