4

Hi guys what is the meaning of double back slash in my Git folder? It is not removed when I do a "git clean -fd". This is the first time I encountered something like this.

$ git status
On branch master
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)

modified: some/folder/hello.php

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

"\\"

no changes added to commit (use "git add" and/or "git commit -a")

Comments
  • 0
    👀 new stuff. I'm interested.

    Did you give some unconventional name to folder and file? Non-unicode text and stuff ?
  • 2
    @cursee The answer is someone made a file named "\" yes a literal backslash with some code. I backed it up by "mv \ /some/folder" lol now it is gone! LOL! 🤣
  • 1
    @Devnergy why would "someone" want to do it? 😮
  • 4
    @cursee it would brick windows builds
  • 3
    @stop then we must encourage such practice more 🤔
  • 2
    too easy. @cursee
  • 3
    I did this in bash: (Does not work on Cygwin, as it translates "\" to "/". 🙄)

    $ touch \\

    I then had a file called '\' and "git status" showed it as "\\". Interestingly I was not able to remove it using git. I guess it gets confused by the backslashes. Then I removed it manually using:

    $ rm '\'

    (Although "rm \\" should have worked, too.)

    How that file got on your machine is a mystery, though...
  • 1
    git clean -ffdx
    Use it with caution
Add Comment