windows - 如何使用 git bash 删除 ~$ 文件(在 Windows 上)
问题描述
即使使用“显示隐藏对象”设置,我也看不到已探索的文件。另一方面,git 将其显示为未跟踪的文件,我发现无法删除它。
有任何想法吗?
git status
On branch devSQC
Your branch is up to date with 'origin/devSQC'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
pathto/~$crazy file.xlsx
nothing added to commit but untracked files present (use "git add" to track)
ls pathto/
'~$crazy file.xlsx'
git rm -f 'pathto/~$crazy file.xlsx'
fatal: pathspec 'pathto/~$crazy file.xlsx' did not match any files
我知道这些是用于恢复的 windows 文件,但 windows 也不允许做任何事情,我希望 git bash 更好;-) 参见例如这里,但我希望,我不需要安装额外的工具......
解决方案
我刚刚意识到,在 bash 中删除这些文件很简单(当然,它与 git 无关......)
cd path2/
rm -f '~$FHS_Noten STAT_FS2019_TZ17_Noten_Vorlage.xlsx'
git-rm
不起作用,因为它
从工作树和索引中删除文件
所以它不是删除文件的功能。
推荐阅读
- matplotlib - 如何通过 matplotlib 在 spyder3 中绘图?
- java - 如何在java中将二进制有效负载(文件)转换为字节[]?
- ios - iOS 拖放。如何在拖动时用自定义视图替换单元格
- c++ - 编写 gtest 验证类是否为空
- javascript - Firebase 云消息传递 - JS SDK 中的 getToken() 错误
- android - Android Arcore Plane Tracker 目标
- python - 在 bash 和 python 之间保持 oracle DB 连接
- javascript - 计算 HTML5 画布中块箭头的点
- amazon-web-services - EC2 AWS 上的 Python Flask 应用程序,由 apache2 托管
- sql - Find by some columns with latest version