develog

[github] ssh 설정 (mac) 본문

Dev/git

[github] ssh 설정 (mac)

냐옴 2021. 8. 3. 09:29

ssh key 생성 (mac)

$ cd ~/.ssh

$ ssh-keygen -t rsa -b 4096 -C 'company@email.com' -P '' -f ~/.ssh/id_rsa-company

$ ssh-keygen -t rsa -b 4096 -C 'company@email.com' -f ~/.ssh/id_rsa-company

pub key 클립보드로 복사 (mac)

$ pbcopy < ~/.ssh/id_rsa-company.pub

github.com 에 pub key 등록 (github.com)

Settings > SSH and GPG keys > New SSH key > Add SSH key
- Title : company@email.com
- Key   : <Paste>

git config 설정 (mac)

$ cd ~/.ssh
$ vi config
Host github-company
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_rsa-company
    #IdentitiesOnly yes

ssh 접속되는지 테스트 (mac)

$ ssh -T git@github.com-company

git clone (mac)

$ git clone git@github-company:myGithubId/repo-name

'Dev > git' 카테고리의 다른 글

git commit 취소  (0) 2021.08.25
[git] diff  (0) 2021.08.09
[git] branch 명령어  (0) 2021.07.01
[git] 커밋 수정/취소  (0) 2021.07.01
[git] client tool  (0) 2021.06.30
Comments