大多數時候我會為我的分支生成一個 diff 檔案,如下所示: git diff trunk.. > .git/diffs/branch_name.diff
我想做的是更改branch_name為git branch --show-current. 我試過做類似的事情,git diff trunk.. > '.git/diffs/ $(git branch --show-current) .diff'但將其存盤為檔案名文學作為 $(git branch --show-current) .diff
有沒有辦法讓我作為單班輪做到這一點?
uj5u.com熱心網友回復:
Unix shell 忽略單引號(撇號)內的元字符。使用雙引號或不使用引號:
git diff trunk.. > ".git/diffs/ $(git branch --show-current) .diff"
或者
git diff trunk.. > .git/diffs/ $(git branch --show-current) .diff
附注。雙引號中的一些元字符也會被忽略。最值得注意的是*。比較echo *和echo "*"
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/346815.html
上一篇:推送后我無法提交
