git verify-pack和PowerShell

时间:2016-06-02 14:22:42

标签: git powershell

我正在尝试将此脚本移植到PowerShell:

https://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/

在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中是不可能的吗?

1 个答案:

答案 0 :(得分:1)

看起来Git依赖于shell的通配符扩展。在PS中你必须自己做:

git verify-pack -v (Get-ChildItem '.\.git\objects\pack\*.idx')