git - unable to create temporary file: no such file or directory - only for certain files?

后端 未结 5 1944
孤街浪徒
孤街浪徒 2021-01-05 08:31

I\'ve got a strange issue here with one of my git repositories. I cannot add certain files. Git states:

$ git add Konstrukti

相关标签:
5条回答
  • 2021-01-05 08:56

    If you have "Controlled folder access" enabled in Windows 10, it might be the reason for this error.

    You'd normally get a notification in the action center when such an action is blocked by Windows, similar to this:

    To resolve that, press to open the start menu, and type "Controlled folder access" or part of it and launch it.
    Click "Block history" and if git is there, give it access by clicking "Allow on device" (only present if not already configured - hence absent in the screenshot):

    This solved the issue for me.

    0 讨论(0)
  • 2021-01-05 08:59

    This worked for me:

    export TMPDIR="/tmp/"
    

    Yep, seriously. No idea what this actually did, but it worked, so I'm not exactly complaining. This might be a fix that only worked for me, because I can't reproduce the problem now that I've fixed it.

    If the problem recurs when you relog, put it at the bottom of your ~/.bashrc.

    0 讨论(0)
  • 2021-01-05 08:59

    I had protected folders enabled in windows. You need to add git to apps that can modify certain folders.

    0 讨论(0)
  • 2021-01-05 09:05

    Try and clone your /v/ownCloud/Bachelor Thesis (Vorlage2) into a much soimpler path:

    c:\Test
    

    Then try and add that file within that simple path.

    0 讨论(0)
  • 2021-01-05 09:17

    I had the exact same problem when adding files. The following did the trick for me:

    git config --global core.fscache false
    

    Don't know exactly why it works but hopefully it can work for others.

    0 讨论(0)
提交回复
热议问题