[英]Windows equivalent of this gitk Linux command
從這個SO: 如何在Git中恢復掉下的存儲?
我想將此Linux命令轉換為Windows等效命令,或者這對於Windows在語法上是正確的,不確定$
和|
:
gitk --all $( git fsck --no-reflog | awk '/dangling commit/ {print $3}' )
我試過在Windows Git Shell,Powershell和Cmd.exe上運行此cmd,其中cd
為git目錄,並帶有Cmd.exe:
在Git Shell上:
這給了我以下錯誤:
我已經安裝了gawk: http : //gnuwin32.sourceforge.net/packages/gawk.htm
並將C:\\Program Files (x86)\\GnuWin32\\bin
到我的Path
環境變量中
好的,所以我必須安裝gawk / awk: http : //gnuwin32.sourceforge.net/packages/gawk.htm
然后我更新了Path
環境變量: C:\\Program Files (x86)\\GnuWin32\\bin\\
然后,我必須重新啟動計算機以刷新環境變量。
然后,我可以運行gitk cmd,而無需進行任何更改,就可以在Windows機器上正常運行:
gitk --all $( git fsck --no-reflog | awk '/dangling commit/ {print $3}' )
但是它必須在Windows Git Shell中,該cmd不能從Windows cmd.exe運行。
這是Windows PowerShell等效項:
gitk --all $(git fsck --no-reflog | Select-String "(dangling commit )(.*)" | %{ $_.Line.Split(' ')[2] })
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.