자바스크립트 공부로 일단 강의를 보면서 따라하면서 기능들을 파악해보려고 했다.
파일 관리를 git으로 하려고 폴더를 만들어 README파일을 만둔 후 깃으로 파일을 push 했더니 오류가 발생했다
user$ git push origin master
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
SHA256:(key)
Please contact your system administrator.
Add correct host key in /Users/user/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/user/.ssh/known_hosts:8
Host key for github.com has changed and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
이전까지는 웹에서 직접 다뤄보고 이번에 CLI 환경에서도 연습해보려고 해봤더니 에러가 발생했다
찾아보니 RSA 키가 변경된게 문제인거 같다.
(git계정을 한번 바꿔서 그런 문제가 발생한건가..? 싶기는 하다.)
해결책을 알아보니
"ssh-keygen -R ip주소" 를 통하여 key를 갱신해주면 해결 된다고 한다.
다만 여기서 ip주소에 대해서 찾아보고 사용해본 결과 도메인을 입력해도 해결되었다
user$ ssh-keygen -R githu.com
# Host github.com found: line 1
/Users/user/.ssh/known_hosts updated.
Original contents retained as /Users/user/.ssh/known_hosts.old
이후 깃에 등록을 하면 (중간에 yes 입력)
user$ git push origin master
The authenticity of host 'github.com (20.27.177.113)' can't be established.
ED25519 key fingerprint is SHA256:(key)
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
리포지토리가 없었다... 그래서 리포지토리를 만들어 다시 등록을 해주었더니 해결되었다.
(출력메세지는 복사하지 못하였다 다음에 기회가 되면 한 번 더 다뤄볼까 한다)
gh auth login
(gh 버전이 오래되었다면) brew upgrade gh
gh repo create reponame --public --source=. --remote=upstream --push