1

I use Git v2.26.2 on Windows 10 and git status to check my directory status. During the compilation of my application, a tool created a junction in my directory which is fine. But git status returns no changes to the directory.

How can I make git status or git clean aware of the existence of any link or junction that doesn't belong to the repo?

P.S. git clean -xdf doesn't remove the junction either

Daniel Stephens
  • 2,371
  • 8
  • 34
  • 86

1 Answers1

1

A junction would be seen as an empty repository which would not register with Git.

a true directory symlink, with a Git for Windows enabling symlinks, would record a file with the destination path in it.
(git config core.symlinks true)

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • But shouldn't git see/treat the junction like as a mounting point on Linux and treat it as it would be a real directory? – Daniel Stephens May 09 '20 at 00:57
  • @DanielStephens On Linux, maybe, but this is Windows here, and junctions (https://learn.microsoft.com/en-us/windows/win32/fileio/hard-links-and-junctions) is a link between folders: Git does not register folders alone. – VonC May 09 '20 at 00:59