git - unable to create temporary file: no such fil

2020-07-09 07:28发布

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

$ git add Konstruktion/Druckteile/1x_*
warning: CRLF will be replaced by LF in Konstruktion/Druckteile/1x_Hals.gcode.
The file will have its original line endings in your working directory.
error: unable to create temporary file: No such file or directory
error: Konstruktion/Druckteile/1x_Nickhalter_links.STL: failed to insert into database
error: unable to index file Konstruktion/Druckteile/1x_Nickhalter_links.STL
fatal: adding files failed

But only for this single file. All other files in the same directory, even with similar names (e.g. 1x_Nickhalter_rechts.STL) work like a charm. Why only this file? What's special about it?

What can I do to figure out what's wrong?

Ah, just for info: it's git 1.8.5.2.msysgit.0 running on Windows 8.1 (64bit).

Thanks a lot.

Cheers, Hendrik

标签: git
4条回答
虎瘦雄心在
2楼-- · 2020-07-09 07:55

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.

查看更多
闹够了就滚
3楼-- · 2020-07-09 08:09

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.

查看更多
ら.Afraid
4楼-- · 2020-07-09 08:14

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.

查看更多
太酷不给撩
5楼-- · 2020-07-09 08:18

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

查看更多
登录 后发表回答