728x90
1. 새로운 ssh key 생성
배시 쉘에서 아래 명령어를 통해 ssh key를 생성한다.
$ ssh-keygen -t ed25519 -C "your_email@example.com"
2. ssh-agent에 ssh key 등록
ssh-agent를 실행하고, ssh key를 등록한다.
$ eval "$(ssh-agent -s)"
$ ssh-add ~/.ssh/id_ed25519
3. github에 ssh key 등록
아래 명령어를 통해 ssh를 복사하거나 파일을 직접 열어 복사한다.
$ clip < ~/.ssh/id_ed25519.pub
github 설정에서 ssh key를 등록한다.
4. git push
로컬 git에 있던 파일을 github로 push한다.
리포지토리를 아예 새로 생성해야 하는 경우에는 아래 명령어를 입력한다.
echo "# boiler_plate" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/eskim-o/boiler_plate.git
git push -u origin main
이미 존재하는 리포지토리에 push하는 경우에는 아래 명령어를 입력한다.
git remote add origin https://github.com/eskim-o/boiler_plate.git
git branch -M main
git push -u origin main
*본 포스트는 인프런 <따라하며 배우는 노드, 리액트 시리즈 - 기본 강의> 강좌 수강 후 정리한 내용입니다.
728x90