git状态所提供的信息包括:
git status
On branch master
Your branch is ahead of 'origin/master' by 2 commits.
(use "git push" to publish your local commits)
Untracked files:
(use "git add <file>..." to include in what will be committed)
"src/HomeBundle/Entity/\320Apartments.php"
"src/HomeBundle/Repository/\320ApartmentsRepository.php"
"src/HomeBundle/Resources/config/doctrine/\320Apartments.orm.yml"
nothing added to commit but untracked files present (use "git add" to track)我想从我的计算机中删除这些文件,因为我无意中创建了这些文件。
我试着表演:
git rm "src/HomeBundle/Entity/\320Apartments.php"
fatal: pathspec 'src/HomeBundle/Entity/\320Apartments.php' did not match any files
git rm '"src/HomeBundle/Entity/\320Apartments.php"'
fatal: pathspec '"src/HomeBundle/Entity/\320Apartments.php"' did not match any files
rm '"src/HomeBundle/Entity/\320Apartments.php"'
rm: cannot remove ‘"src/HomeBundle/Entity/\\320Apartments.php"’: No such file or directory
rm "src/HomeBundle/Entity/\320Apartments.php"
rm: cannot remove ‘src/HomeBundle/Entity/\\320Apartments.php’: No such file or directory
git rm '"src//HomeBundle//Entity//\320Apartments.php"'
fatal: pathspec '"src//HomeBundle//Entity//\320Apartments.php"' did not match any files
git rm "src//HomeBundle//Entity//\320Apartments.php"
fatal: pathspec 'src//HomeBundle//Entity//\320Apartments.php' did not match any files
rm '"src//HomeBundle//Entity//\320Apartments.php"'
rm: cannot remove ‘"src//HomeBundle//Entity//\\320Apartments.php"’: No such file or directory请帮我找到并移除它们!
发布于 2016-06-07 20:51:54
你不需要像“src//.”那样的双斜杠。“
您使用的是linux终端,所以您可能使用bash。尝试自动完成:
rm src/H<tab><tab>
rm src/H,然后按两次选项卡,它将完成到"src/HomeBundle“,然后添加"/E”并按两次选项卡。如果有必要,这将帮助您自动完成路径转义字符。发布于 2016-06-07 21:18:53
您可以运行‘git清洁-f’来从工作目录中删除所有未跟踪的文件。添加‘-d’选项以删除目录。您也可以使用'git干净-n‘来检查将要删除的内容(所谓的“deleted”)。
发布于 2016-06-07 20:44:20
使用git rm file_name命令删除文件跟踪。
https://stackoverflow.com/questions/37688935
复制相似问题