簡體   English   中英

在 Windows 中通過 sshd 使用 git - 卡在推送中

[英]Using git in windows over sshd - stuck in push

在我的環境中,我無法登錄到 Windows GUI,但是我必須使用 sshd 從 Windows Server 2019 獲取控制台(cmd.exe)。安裝了 Git,但是一旦我嘗試執行 git push,我面臨一個問題:

通常,在 Windows 的 CMD 控制台中,會彈出一個帶有憑據管理器的窗口,這不適用於這個用例,我實際上是通過膩子“ssh-ed”到 Windows 服務器的。 好像是git卡住了,明顯是想開窗。

如何關閉此行為,並使 Windows 上的 git 更加“unix-ish”,以便像在 Linux 環境中一樣,用戶名/密碼提示出現在控制台上?

嘗試禁用憑證助手(在您的 SSH 會話中)

git config credential.helper=

這將允許您測試 Git 是否在命令行上要求提供憑據而不是打開彈出窗口。
請注意,這僅適用於克隆 HTTPS URL 的情況。

替代選項:

cd path/to/repo
git config --system --unset credential.helper
git config --global --unset credential.helper
git config --unset credential.helper

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

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