User Tools

Site Tools


wiki:git_pull_via_ssh_public_key

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
wiki:git_pull_via_ssh_public_key [2022/03/14 13:35] – [See also] add new link antisawiki:git_pull_via_ssh_public_key [2025/08/25 14:31] (current) – [References] add serverfault link antisa
Line 24: Line 24:
 </code> </code>
  
 +==== Use different host ====
 +You can use a custom hostname as well, e.g.
 +
 +
 +<code>
 +Host github-someorg
 +        HostName github.com
 +    IdentityFile ~/.ssh/myuser_github
 +</code>
 +<WRAP center round info 60%>
 +When using Vim vim-fugitive plugin, the GBrowse command can only work with above if it is set in ~/.ssh/config file, not in ~/.ssh/ssh_config.d directory.
 +</WRAP>
 +
 +
 +Then to clone use that host
 +
 +  git clone git@github-someorg:someuser/repo.git
 +  
 +<WRAP center round important 60%>
 +SSH will try all of the keys it sees, so the ones provided by any running ssh-agent and the file specified above in IdentityFile. This might not be what you want, because if the ssh key from the ssh-agent is used by your different github user for different repos.
 +
 +To explicitly use only the key in IdentityFile also add ''IdentititesOnly yes'' to the configuration.
 +</WRAP>
 +
 +  
 ====== Tested on ====== ====== Tested on ======
   *    * 
Line 31: Line 56:
 ====== References ====== ====== References ======
  
 +  * https://serverfault.com/a/515214
wiki/git_pull_via_ssh_public_key.1647264917.txt.gz · Last modified: by antisa

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki