1
當使用SmartGit作爲SSH客戶端時,它會緩存第一個選定的密鑰。當你進一步嘗試拉/推到另一個回購,SmartGit說"Access denied"
。如何在SmartGit中爲不同的Bitbucket回購使用不同的密鑰?
SmartGit保存到首選項使用什麼鍵來連接到Bitbucket。但是,SmartGit偏好設置中的所有回購地址都是:ssh://[email protected]
。
當使用SmartGit作爲SSH客戶端時,它會緩存第一個選定的密鑰。當你進一步嘗試拉/推到另一個回購,SmartGit說"Access denied"
。如何在SmartGit中爲不同的Bitbucket回購使用不同的密鑰?
SmartGit保存到首選項使用什麼鍵來連接到Bitbucket。但是,SmartGit偏好設置中的所有回購地址都是:ssh://[email protected]
。
由於mentioned here和this thread,你應該能夠reference multiple private ssh keys in a %HOME%\.ssh\config file
,更改url爲bitbucket1:userA/myrepo1
,bitbucket2:userA/myrepo2
。
這意味着:
%HOME%\.ssh\config file
有:配置:
host bitbucket1
user git
hostname bitbucket.org
port 22
identityfile /C/path/to/.ssh/key1
host bitbucket2
user git
hostname bitbucket.org
port 22
identityfile /C/path/to/.ssh/key2
/C/path/to/.ssh/
,你有一個key1
(私人)和key1.pub
(公共)ssh文件(key2
/key2.pub
相同)