如何使用 git bash(在 windows 上)删除 ~$ 文件

How can I remove ~$ files using git bash (on windows)

即使使用 "show hidden objects" 设置,我也没有在探索中看到该文件。 另一方面,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 更好 ;-) 参见例如here 但我希望,我不需要安装额外的工具...

我才发现,删除bash内的那些文件很简单(当然跟git没关系……)

cd path2/
rm -f '~$FHS_Noten STAT_FS2019_TZ17_Noten_Vorlage.xlsx'

git-rm 不起作用,因为它

Remove files from the working tree and from the index

所以不是删除文件的功能