2

That's one of the weirdest prob I've encoutered with Git. Before I deleted index.lock file, Git tells me that this file was used by one another process and proposed me to delete this file to continue. Since I'm using Cygwin with ConEmu, it sometimes happens that my setup begins to be a bit unstable, so I removed it. But after that, If I do a git status I see something like that :

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        ...*some file to commit*...
        C:/

Of course If I try a git add . it will never end... I was able to add the legit modified files into a commit but C:/ still there ... really weird, any idea of what to do ?

snoob dogg
  • 2,491
  • 3
  • 31
  • 54
  • The index.lock file often contains the *next* index and it's possible that the *current* index was lost and now there's no index at all. In this case, every work-tree file will be untracked, by definition. But this suggests that your work-tree is in `/c` or `C:/` which is not a good place for a work-tree, so perhaps something else is wrong as well. – torek Feb 28 '20 at 00:50

2 Answers2

1

First, make sure to use Git For Windows, not git as installed as a Cygwin package.
The most recent versions of Git for Windows do manage index.lock better (example with Git 2.25)

Second, make sure there is no .git subfolder right under C:\, or Git would consider the all drive as one giant Git repository.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

Fixed, no idea how it appeared but I had a symbolic link to C:/ in my folder. Just had to delete it

snoob dogg
  • 2,491
  • 3
  • 31
  • 54