인텔리제이를 사용하면서 깃허브데스크탑이나 소스트리를 설치할 필요성을 못느껴서
인텔리제이에서 직접 commit 과 push를 하려고 한다.
그럼 제일 처음부터 인텔리제이에 github 계정을 등록해 줘야한다.
File - Setting - Github - 사용자의 깃허브 계정 입력
상단 Git - Github - Share Project on Github 선택
remote 적고 Description 부분은 입력하지 않아도 share 가능하다. SHARE 선택하면 오른쪽 하단에 성공했다고 뜬다.
Successfully created project 'thisisjava' on GitHub, but initial push failed: git@github.com: Permission denied (publickey). Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
● ssh -keygen -T rsa -C "사용자의 깃허브 계정 이메일주소"
//사용자의 깃허브 계정을 이메일 형식으로 적어주세요.
Enter 누르기
● Enter file in which to save the key (C:\Users\사용자.ssh/id_rea):
//key가 저장된 경로가 보여요.
Enter 누르기
● Enter passphrase (empty for no passphrase):
//비밀번호를 입력해 주세요. (안 적어도 됨)
Enter 누르기
● Enter same passphrase agin:
//비밀번호를 다시 한 번 입력해 주세요. (안 적었으면 Enter 누르기)
Enter 누르기
해당 파일 내에 있는 텍스트를 복사한다.
Github로 고고
본인 프로필 누르고 - Settings - 왼 쪽 목록에서 SSH and GPG Keys로 들어가기
SSH Keys 옆에 있는 New SSH Key 클릭 후
Tittle은 적지 않아도 되고, 밑에 있는 Key 박스에 위에서 복사한 텍스트를 붙여넣고
Add SSH Key를 클릭하면 끝!
● ssh -T git@github.com
Warning: Permanently added the ED25519 host key for IP address 'IP 주소' to the list of known hosts. //비밀번호 설정 했으면 비밀번호 입력 후 아래 문구 나옴.
Hi "사용자"! You've successfully authenticated, but GitHub does not provide shell access.
이렇게 뜨면 성공!