어젯밤부터 계속 publickey 문제로 갑자기 git push가 안된다고 나와서 몇시간이나 고생을 했는데, 역시 안될 땐 그냥 덮어두고 다음날 새로 시작하는 기분으로 집중해서 찾아보니까 고쳐졌네요 휴. 쓰던 repository 그냥 삭제하고 새로 만들까 고민했는데, 고쳐져서 너무 다행입니다 😭
저는 아래의 글들 도움되었어요.
1. 로컬 머신에 SSH key 만들고 깃헙에 추가하는 법
https://gist.github.com/adamjohnson/5682757
Fix "Permission denied (publickey)" error when pushing with Git
Fix "Permission denied (publickey)" error when pushing with Git - publickey-git-error.markdown
gist.github.com
2. 로컬 머신에 SSH key 만들고 깃헙에 추가하는 법 (1과 같은 내용이지만 깃헙에서 어디에 추가하면 되는지 자세히 나와있어요!)
https://jhooq.com/github-permission-denied-publickey/
How to fix - git@github.com permission denied (publickey). fatal could not read from remote repository and Support for password
git@github.com: Permission denied (public key).fatal: Could not read from remote repository. - It means GitHub is rejecting your connection because - It is your private repo GitHub does not trust your computer because it does not have the public key of you
jhooq.com
3. 현재 branch가 protected 되어있어서 git push --force 가 안될 때
https://docs.gitlab.com/ee/user/project/protected_branches.html
Protected branches | GitLab
Documentation for GitLab Community Edition, GitLab Enterprise Edition, Omnibus GitLab, and GitLab Runner.
docs.gitlab.com
이거 참고하면서 저는 해당 repository의 settings로 들어가서 잠시 Allow force pushes를 허용하고 휘리릭 git push --force 하니까 해결되었습니다.
![](https://blog.kakaocdn.net/dn/bDEbhW/btrQpWnvu5a/BiXqYp19qisvrQenjRC0b1/img.png)
![](https://blog.kakaocdn.net/dn/lChx9/btrQq6o9hVF/EksBKq7bV0scuP3WPvTsu0/img.png)
'웹개발 > 혼자하는 개발 공부' 카테고리의 다른 글
SQL vs NoSQL (0) | 2023.01.21 |
---|---|
프론트엔드 최신 트렌드 뉴스레터로 구독하기 (Collective, Free Code Camp, TechTO (2) | 2023.01.06 |
코딩으로 아트 작품 만들기 - Creative Coding: Making Visuals with JavaScript (내가 좋아서 쓰는 리뷰) (0) | 2022.09.15 |
Missing "key" prop for element in array (0) | 2022.09.12 |
Sorting Algorithms (0) | 2022.02.20 |