1

For a java app I'm working we store some Ubuntu fonts in our git repository. Keep in mind, this all works as expected for other devs on other machines with a similar setup.

This issue occurs only using WSL Git and not Git for Windows/Git Bash (gitforwindows.org).

Windows (specifically System32/fontview.exe), and our application for that matter, cannot open/load these font files when they're in a git repo.

The requested file ... is not a valid font file.

mving that same file to any location outside of a Git repository, Windows is able to open the file. The file is the same (checked using sha1sum < fontfile.ttf).

The same error is also thrown when copying that file into a newly initialized Git repository.

This is true for all ttf files, even if they're newly downloaded from the web.

Even after rm -rf .git the files still cannot be opened/loaded. That specific directory name somehow becomes permanently affected.

The problem persists after a reboot.

7
  • Does this happen with any git repository? Are you able to open them from the same folder before you create a git in it?
    – Seth
    Apr 3, 2019 at 13:01
  • 1
    @Seth any repo, even newly git inited ones. They're find in the same folder before repo creation. Apr 3, 2019 at 13:32
  • @Seth I've been able to narrow it down to NTFS. I don't have these problems on a drive that's formatted FAT32. Apr 8, 2019 at 15:16
  • What does all that have to do with WSL? Running git straight from Windows works fine?
    – Seth
    Apr 9, 2019 at 5:15
  • 1
    @Seth I used the commands from this SU post to look at the file attributes. The one that works looks like I'd expect, the other only has a value for Name, all the other attributes seem to be empty. Apr 9, 2019 at 11:50

1 Answer 1

0

We are told that although accessing Windows files from WSL is OK (via /mnt/c , /mnt/d etc ), doing it the other way round, is not supported, due to the way the Linux filesystem is emulated (?) in Windows.

Hence you should copy your files to a location back in the Windows environment proper (eg. /mnt/c/Users/joebloggs/workspace ....), before trying to access them with Windows-based tools.

However, things might change, this new functionality will allow you to access the Linux filesystem like a network drive:

https://betanews.com/2019/02/16/access-linux-files-from-windows/

If you just want to run git in Windows, use "Git for Windows" without WSL ! eg https://git-scm.com/download/win

3
  • Is it already known if this limitation will still exist with the new WSL Microsoft announced recently? May 16, 2019 at 8:03
  • I would expect it to still be there, due to the way the subsystems need to interact. I export things back to the Windows /mnt/c if I need to. Hope this is worthy of an Answer ;-)
    – MikeW
    May 16, 2019 at 8:27
  • Update: see the extra info in the answer. You will be able to access the Linux filesystem like a network drive.
    – MikeW
    May 17, 2019 at 8:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .