0

Somehow, my system (Ubuntu WSL layer on Windows; so treat as exactly Ubuntu) went a bit crazy. For a directory (a git repo if it matters) /path/to/foo, running ls shows the git files ORIG_HEAD, index, and index.lock in there.

I tried to debug this by going cd .git, but an ls there showed me my same list of files as the parent!

I went as far as

/path/to/foo/.git/.git/.git

before stopping checking the recursion.

A possibly related issue that managed to show up is that the .htaccess file there is read as a file by Emacs on Windows, a file by vi on Linux, but a directory by emacs and a directory by bash.

That means that my computer really thinks

~/public_html/.git/.htaccess/.htaccess/.git/.htaccess/.git/.git

is identical to

~/public_html

So, needless to say, Apache also craps out and says that it's an invalid htaccess file .... though on an other machine (see: git repo) it runs just fine.

Help?

Philip Kahn
  • 614
  • 1
  • 5
  • 22
  • Looks like `.git` is a symbolic link to the current directory: `ln -s . .git` You can see something similar in, for example, http://archive.ubuntu.com/ubuntu/ubuntu/ – muru Feb 27 '17 at 09:32
  • @muru but then shouldn't `rm .git` work? I get the standard `Is a directory` error. Similarly, via [this link](http://stackoverflow.com/a/1412554/1877527), `symlinks -v .` shows nothing. I'd also then expect `rm .htaccess && git checkout -- .htaccess` to fix links to the file, which also doesn't work. – Philip Kahn Feb 28 '17 at 15:23

1 Answers1

0

Tried nuking the directory via rm -rf and git clone-ing back, but the Apache problem persisted.

I removed the symlink to the directory via unlink:

~$ unlink public_html

then re-mounted it, making sure that there wasn't a trailing space

~$ ln -s /mnt/c/Users/USER/pathto/repo /home/USER/public_html
Philip Kahn
  • 614
  • 1
  • 5
  • 22