按照mail的指示, git clone 時卻發生找不到key的情況,

最終強者同事幫我找了 stackoverflow的其中一個解答 ...

 

You can achieve that using a ssh config file.

First create a file inside your ~/.ssh folder named config, you can use some command like the following

$ nano ~/.ssh/config

Then, the content of the file should have the location of your key based on each host name. for example:

Host github.com
 IdentityFile ~/myPublicKeyFolder/myGitHubFile
Host heroku.com
 IdentityFile ~/myPublicKeyFolder/myHerokuFile

So, when git tries to access each host it will follow the rules inside this config file based on the git host your trying to reach

 

Reference:

http://stackoverflow.com/questions/5323778/setting-a-custom-path-for-git-private-ssh-key-on-linux

 

 

 

 

arrow
arrow
    全站熱搜

    kk 發表在 痞客邦 留言(0) 人氣()