0

Trying to initialize a git repository and receive error -

fatal: cannot stat '.../.git/description': Not a directory.

So I do 'ls -a' and see that it created my .git folder, but it's empty. So I figure it out, and go inside it and create a directory called "description". Then I climb out of the .git folder back into my project folder, and attempt git init again. This time it gives me the same error with a different directory name (since it found 'description', i assume). So I try the same thing with that folder. Upon my next attempt, I get the same error regarding yet another missing folder. Now I don't know too much about what's supposed to be in the .git folder, but I have come to the conclusion that I am not supposed to be responsible for the creation of these subfolders within .git... Anyone know what may be wrong? Below is my .gitconfig file's contents:

[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[core]
askpass = git-gui--askpass

I found this question, but the OP here just didn't know how to view the .git folder: git init will not create git directories for me

I have not found anything else directly relating to my issue yet.

EDIT: Just confirmed that git init works in directories on my C:/ drive. This issue arises on my F:/ drive, which is a network drive. Could this be the issue?

OS: Windows 10 Git: git version 2.20.1.windows.1

Info I've found so far on how my F: drive is mounted, though I'm not sure yet what it means:

F:\>df
Filesystem                                     1K-blocks        Used  Available Use% Mounted on
C:/Users/di203179/AppData/Local/Programs/Git   124418044    94816860   29601184  77% /
F:                                           18253611008 14182661885 4070949124  78% /f
N:                                           16106127360 10468462200 5637665160  65% /n





F:\>mount
C:/Users/di203179/AppData/Local/Temp on /tmp type ntfs (binary,noacl,posix=0,usertemp)
C:/Users/di203179/AppData/Local/Programs/Git on / type ntfs (binary,noacl,auto)
C:/Users/di203179/AppData/Local/Programs/Git/usr/bin on /bin type ntfs (binary,noacl,auto)
C: on /c type ntfs (binary,noacl,posix=0,user,noumount,auto)
F: on /f type cifs (binary,noacl,posix=0,user,noumount,auto)
N: on /n type cifs (binary,noacl,posix=0,user,noumount,auto)
dillon.harless
  • 387
  • 2
  • 11
  • Description should be a single-line text file. I guess the problem is that it's not seeing .git as a directory for some reason. You can always git init on C and copy the brand-new .git folder to the right place on F? – Rup Feb 28 '19 at 15:00
  • I hear you; I'll give that a go. Thanks for the suggestion. – dillon.harless Feb 28 '19 at 15:09
  • Strange. I just did a Git init on a network drive (f: in my case) without trouble, both in GitBash and in cmd. I would guess you have compatibility issues with your network. Maybe specify your version and distro of Git, your OS, and maybe how your network drive is mounted, in the hope someone with the same configuration can reproduce the problem? – joanis Feb 28 '19 at 15:09
  • @joanis I'm willing to do that, but I will need some clarity on determining how it's mounted since I'm not familiar with that. If you're interested in helping me figure that out feel free to pm me. – dillon.harless Feb 28 '19 at 15:16
  • @dillon.harless I'm not sure I'll be able to help, my suggestion is to enhance your question with additional information in the hope someone in the SO community will recognize your problem. The more your provide, the more likely it is someone can help you. – joanis Feb 28 '19 at 15:19
  • @joanis Okay I'll try to figure it out, thanks! – dillon.harless Feb 28 '19 at 15:26
  • I've updated with what I've found so far on the way my drive is mounted. If anyone has input/suggestions on how to better explain the issue, don't hesitate. – dillon.harless Feb 28 '19 at 15:31
  • cifs is just normal Windows networking. You can probably see more with `net use`, but there won't be any details of the server type that's hosting the share, or the type of the filesystem that it's sharing. However even if you could find that out I'm not sure what you could do with it. I'd guess there's some odd behaviour on the server and there's a timing issue here, or something, and you might have to follow up with whoever runs your network if you can't work around it. – Rup Feb 28 '19 at 15:38
  • @Rup Your initial suggestion did work for me. Though it's a nuisance I hope to avoid one day, it really doesn't take that long to copy a .git folder over. I'll follow up with the networking team and if I find a solution I'll update this. – dillon.harless Feb 28 '19 at 16:23
  • If it's a network drive, all the *files* on it are actually on some other computer. That other computer might arbitrarily deny permission to some files and/or directories at whim, as it were. Ultimately, it will all be explainable, but not from *your* computer as the problem probably isn't *in* yours, but in someone else's. (See the quote at http://thinkexist.com/quotation/a_distributed_system_is_one_in_which_the_failure/189402.html) – torek Feb 28 '19 at 17:07
  • @torek That's what I feared, haha. But that's clarified it. Great quote. If you want to post an answer I'll accept it. If not, I'll throw one up for anyone in my position. – dillon.harless Feb 28 '19 at 19:35
  • I don't know enough about Windows and samba/cifs to supply anything directly useful. (I stick with Unix/Linux/MacOS based systems, mostly...) – torek Feb 28 '19 at 19:47

0 Answers0