![](/img/trans.png)
[英]sh script doesn't add ssh key to ssh-agent (windows git bash)
[英]gitbash (cache passphrase key): Can't get the ssh-agent to run on windows, modified the .bashrc & .profile
誰能幫忙,我在Windows上,git正在將我的來源設置為github。
當然,每次我想拉/推或任何我需要為github提供密鑰的密碼短語時,都可以。
根據我閱讀的內容,我需要編輯〜/ .profile或〜/ .bashrc並輸入一些文本
參見https://help.github.com/articles/working-with-ssh-key-passphrases
我已經做了很多次,實際上我在兩個文件中都輸入了它,但是當我打開一個新的GitBash窗口時,似乎什么也沒運行(我猜想應該運行一些東西,並根據上面的鏈接向我詢問密碼)。
因此,當然,每次“推”或“拉”操作每次都會要求我輸入密碼。
我很想念這里的東西,有人可以幫忙嗎?
記住我在Windows :-)上,並使用git自帶的gitbash用於Windows。
提前致謝
經過大量調查,我發現此記住密碼,Windows下的Git bash
確切解釋了所需的內容,它與出現的linux不同。
如果您已經通過“ https”方法克隆了存儲庫,現在嘗試以“ ssh”方式或其他方式推/拉,則可能會發生這種情況。 看看這是否適合您:
git remote set-url origin git@github.com:your_account/your_repo.git
在Windows 10上這對我有用
touch ~/.profile
start ~/.profile
打開.profile
.profile
#! /bin/bash
eval `ssh-agent -s`
ssh-add ~/.ssh/*_rsa
基於此答案 。 唯一的區別是.bashrc
不起作用,而.profile
起作用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.