Commands/git + github

(ubuntu) github repository 을 ssh 로 액세스

꼰대코더 2025. 12. 7. 21:56

1. git 을 인스톨

sudo apt install git 

 

2. 유저설정

git config --global user.name 사용자이름
git config --global user.email 사용자 이메일 주소

 

3. ssh-key 공개키 작성

ssh-keygen -t rsa -C "메일 주소"

 

디폴트 옵션으로 작성하면 아래의 폴더에 

~/.ssh/id_rsa.pub 

가 생성

 

4. 공개키를 클립보드에 복사

일단 클립보드 복사 툴을 설치

sudo apt update 

sudo apt install xclip

 

공개키 복사

cat ~/.ssh/id_rsa.pub | xclip -selection clipboard

 

5. 4에서 복사한 공개키를 자신의 github 에 설정

github.com 에 로그인

settings >> SSH and GPG keys >> [New SSH Key] 버튼

타이틀을 작성하고 Key 에 붙여넣기 후 [Add SSH Key] 버튼

 

6. Ubuntu에서 접속 확인 

ssh -T git@github.com

yes 를 입력

 

7. Ubuntu 의 터미널에서 

git clone [아래의 SSH 의 링크를 복사]

 

 

'Commands > git + github' 카테고리의 다른 글

5. 고급 git commands  (0) 2025.02.27
4. merge conflict 해결  (0) 2025.02.27
3. bug fix 생성  (0) 2025.02.05
2. tag & release  (0) 2025.02.05
1. git - 정상적인 처리  (1) 2025.02.05