2021년/개발공부

Intellij+git

위지원 2021. 3. 8. 20:57

깃이랑 인텔J랑 연동하고난 뒤에 푸쉬했는데 

아래와 같이 퍼미션 디나인이 뜨면서 push가 안된다.

git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

공개키 만들어서 등록해주면 된다. 아래와 같이 

ssh-keygen -t rsa -C "메일@메일.com"입력하고 엔터 2번해주면 공개키를 만들어준다. 

jiwonwee@jiwon springPractice % ssh-keygen -t rsa -C "깃헙 이메일"
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/jiwonwee/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): <엔터>
Enter same passphrase again: <엔터>
Your identification has been saved in /Users/jiwonwee/.ssh/id_rsa.
Your public key has been saved in /Users/jiwonwee/.ssh/id_rsa.pub.
The key fingerprint is:
>_< ㅎㅎ
The key's randomart image is:

 

그럼 아래 장소에 공개키가 생성되고 이를 복사한다. 

jiwonwee@jiwon springPractice % cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC5TTjMTKjI..<생략>= upsidejiwon@gmail.com

 

이후에 깃헙 사이트 가서 account정보 누르면 아래에  Setting가 있다.

 

Settings에 SSh keys가 있다. New SSH key를 누르고 위에서 복사한거 붙여넣으면 push가 잘된다. 쉽당