📜  ssh github - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:50:13.005000             🧑  作者: Mango

代码示例6
# NAV TO .ssh FOLDER (unix/powershell)
cd ~/.ssh
cd c:/Users/
  
# CREATE "key"
ssh-keygen
# Press enter twice (optionally create pass).
# Two ways to print ~.pub contents.
ssh-agent sh -c 'ssh-add; ssh-add -L'
cat ~/.ssh/id_rsa.pub

## ADD KEY TO GITHUB
# github.com >settings >ssh keys: copy contents to SSH creation.

# NAV TO GIT DIR (unix/win)
cd /srv
cd c:/Users//git

# Start the ssh-agent (Make "lock") (win: use gitbash)
eval `ssh-agent -s` 

# INSERT "key"
ssh-add id_rsa
# Win: if in path /git
ssh-add ./.ssh/id_rsa

# CLONE your repo via ssh from github.