Git
[Git] github와 git연동
heehminh
2021. 12. 27. 01:59
반응형
- 리모트에 연동 (1)
이 폴더(secondProject)를 내 로컬과 연동을 시키겠다.
git remote add origin https://github.com/heehminh/secondProject.git
git init
git add .
git commit -m "initial commit"
- 서버에 연동 (2)
git push origin main
로컬에서 변경사항 서버에 반영(동기화)
- 서버에서 로컬로 가져오기
git clone 리포지토리 주소(로컬)

>git clone https://github.com/heehminh/secondProject.git
Cloning into 'secondProject'...
: 깃허브 리포지토리에서 모든 커밋들을 내 로컬로 가져온다
- 서버에서 변경사항 로컬에 반영
git pull origin main
: 깃허브 리보지토리 메인 브랜치에 현재 커밋들을 넣는다
*참고 master -> main
* gitignore부터 다시
반응형