Search code examples
git

Git status shows a weird string as an untracked file


Git status gives me this:

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

        "\357\200\233\357\200\233OB\357\200\233q"

nothing added to commit but untracked files present (use "git add" to track)

There is no such file or directory:

$ cat $"\357\200\233\357\200\233OB\357\200\233q"
cat: '\357\200\233\357\200\233OB\357\200\233q': No such file or directory

Another weird thing is that the status command before the last commit did not show this weird path string.

Any idea what is going on? should I "git clean -f"? is it safe?


Solution

  • For Ubuntu/Linux :

    Simply remove it command using :

    sudo rm -rf "\357\200\233\357\200\233OB\357\200\233q"
    

    This Happens when a script/command outputs as a newfile with such characters.

    For Windows :

    1) Go to Folder Options => Select Show Hidden & System Files

    2) Browse to your Repository folder.

    3) Remove the file named with "\357\200\233\357\200\233OB\357\200\233q"