우선 키 생성하기
ssh-keygen -t ed25519 -C "your-email@example.com" -f ~/.ssh/id_ed25519_new
ssh에이전트에 키 추가
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519_new
- ssh 키 복사하기
cat ~/.ssh/id_ed25519_new.pub
깃헙에 SSH 키 등록하기.
ssh 설정파일 업데이트
nano ~/.ssh/config
하단에 이거 추가
Host github.com-work
HostName github.com
User git
IdentityFile ~/.ssh/id_ed25519_new
그리고 해당 설정으로 클론 받아오기
git clone git@github.com-work:taehyunkim3/spa-app-240609.git
(만약 기존에 클론 받아왔다면 url 변경해주기)
git remote set-url origin git@github.com-work:taehyunkim3/spa-app-240609.git
해당 프로젝트 유저 이름/이메일 변경
git config user.name '이름'
git config user.email '이메일'
그리고 push
git push
(최초 커밋시)
git push --set-upstream origin main