[英]git from bash script on Windows using MinGW is not configured
我正在編寫一個需要執行一些 git 操作的 bash 腳本。 我正在使用 MinGW 研究 windows。
運行bash test.sh
test.sh
包含以下內容:
echo "git config --global user.name -> $(git config --global user.name)"
這打印:
git config --global user.name ->
而繼續 powershell 並輸入git config --global user.name
打印my_actual_user_name
。
在這種情況下,我想在 git 上使用我的用戶設置,其中包括訪問我的 ssh 密鑰,但它沒有這樣做。 我怎樣才能做到這一點?
嘗試在您的腳本和 PowerShell 中使用:
git config --show-scope --show-origin user.name
您將准確看到用於查詢該設置的文件。
如果它們不同,那將解釋您在 output 中的差異。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.