pHbits
pHbits

Reputation: 386

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?

Upvotes: 7

Views: 1637

Answers (2)

Timerix
Timerix

Reputation: 1

TLDR:

git config --global core.quotepath off

Git prints utf8 characters in octal format for historical reasons. You can disable it by the command above.

full explanation: https://stackoverflow.com/a/22828826/27244494

Upvotes: 0

LuFFy
LuFFy

Reputation: 9297

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"

Upvotes: 6

Related Questions