簡體   English   中英

Windows等效於此gitk Linux命令

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM