79717170

Date: 2025-07-28 10:23:05
Score: 2
Natty:
Report link

For me, everything was working well for months until today morning. All git commands return "fatal : not a git repository". I also work with other git repositories and all have the same problem.

At my work, I am working on a network disk mounted on my machine. Thus all local copies of my git repos (directory where I git clone) are on this network disk. While investigating, I discovered touch tmp gave me an error "Read-only File system" that helped me understand the source of the problem.

For any reason (issue at mounting the disk today?), the file system was mounted read-only (you probably know that when mount with rw fails it is mounted ro...).

Finally remounting the disk with mount -o remount,rw /path-to-workdir/ solved my problem.

So my humble advice - in addition to other great suggestions - is to check also for the write access to the .git directory (either mount access, or user permissions).

Hope it helps!

Reasons:
  • Whitelisted phrase (-1): Hope it helps
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Me too answer (2.5): have the same problem
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Christophe F