我正在尝试将此脚本移植到PowerShell:
在PowerShell中,我从我的存储库的根目录运行git verify-pack:
git verify-pack -v .git\objects\pack\pack-*.idx
但我收到错误:
fatal: Cannot open existing pack file 'C:\test\MyRepo\.git\objects\pack\*.idx'
C:\test\MyRepo\.git\objects\pack\*.pack: bad
我看了一下:
Equivalent of git verify-pack -v | sort | tail
但它并没有真正解决通配符pack-*.idx
。这在PowerShell中是不可能的吗?
答案 0 :(得分:1)
看起来Git依赖于shell的通配符扩展。在PS中你必须自己做:
git verify-pack -v (Get-ChildItem '.\.git\objects\pack\*.idx')