2017-02-15 65 views
0

我在Windows上使用Git Bash。當我做pull/push請求時,git不會要求輸入密碼,但這是非常必要的。 我怎麼能這樣做呢?如何讓git bash在你做拉/推請求時要求密碼?

+0

即使未輸入密碼,是否仍在拉/推工作? –

+0

你使用的是https協議嗎? –

+0

'git config -l'輸出任何'credential'選項嗎? – crea1

回答

0

運行git remote -v

如果回購是在像Github上託管,你應該看到這樣的迴應:

origin [email protected]:username/repo.git (fetch) 
    origin [email protected]:username/repo.git (push) 

這意味着你在爲你的回購SSH協議,並且您需要切換到HTTPS:

git remote set-url origin https://github.com/username/repo.git 

如果您自己託管git服務器,這會變得更加複雜。

+0

跑了。我得到 原點https://[email protected]/repo.git(獲取) 原點https://[email protected]/repo.git(推送) – Anastasia

+0

切換到HTTPS。 'git remote set-url origin https://[email protected]/repo.git' –