簡體   English   中英

git status顯示不存在的未跟蹤文件

[英]git status shows unexisting untracked file

我不知道這個問題應該移到ServerFault還是它屬於這里!

在遠程Unix服務器上工作,我使用FileZilla創建了一個文件file_x.php

我在終端上使用GIT

當我執行git status ,它向我顯示了這一點:

On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)
  some_other_file1.php
  some_other_file2.php
   file_x.php
  ^
  |__ Note this weird blank space

問題:我想刪除此文件,我嘗試從FileZilla刪除,但此操作不起作用,它表明there is no such file or directory 但是文件始終存在!

所以我嘗試了:

rm -rf file_x.php       # This didn't work
sudo rm -rf  file_x.php # I'm not from the sudoers
git checkout file_x.php # This didn't do a thing !
git clear -f            # This didn't do a thing !
git rm file_x.php
==> fatal: pathspec 'file_x.php' did not match any files

我的問題是什么意思? 以及如何刪除該文件?

您必須逃脫空間:

rm \ file_x.php

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM