Git状态显示一个奇怪的字符串作为未跟踪的文件

时间:2017-06-20 09:13:50

标签: git

Git状态给了我这个:

$ 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)

没有这样的文件或目录:

$ 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

另一个奇怪的事情是,在最后一次提交之前的status命令没有显示这个奇怪的路径字符串。

知道发生了什么事吗?我应该“git clean -f”吗?这样安全吗?

1 个答案:

答案 0 :(得分:2)

对于Ubuntu / Linux:

只需使用以下命令删除命令:

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

当脚本/命令作为带有此类字符的新文件输出时,会发生这种情况。

适用于Windows:

1)转到Folder Options =&gt;选择Show Hidden & System Files

2)浏览到您的Repository文件夹。

3)删除以"\357\200\233\357\200\233OB\357\200\233q"

命名的文件
相关问题