사적인 블로그
[git] 로컬 폴더와 github repository 연결, commit하기 본문
간단하지만 맨날 찾아보기 귀찮아서 정리하는 git 브랜치 연결하기
전체 : github에서 repository를 생성했고, HTTPS 주소를 복사했다는 가정하에,,,
로컬 폴더 경로에서 cmd를 열었다는 전제하에,,,
# 로컬파일 원격브랜치 연결, pull 받기
git init # .git 폴더 생김
git remote add origin 리파지토리주소
git pull origin main # read.me 파일 생김
# git push하기
git add --all
git commit -m "메세지"
git push origin main
여기서 error: src refspec main does not match any
라는 에러가 난다면
git push origin master
로 해주고, main 브랜치에 머지해주면 됩니다.
끗!
'TIL' 카테고리의 다른 글
[Linux] 디바이스 구성 / sd, vd, hd (0) | 2025.03.24 |
---|---|
[Redis] Redis cli 로 hash key 복사 쉽게 하기 (0) | 2025.03.05 |
[Linux] alias 등록 (0) | 2025.02.14 |
[Crawling] python, mongoDB(pymongo) 로 특정 키워드 신규 게시물 알림 메일로 발송하기 (1) | 2025.02.07 |
[Cache] Cache 전략(read, write) (0) | 2025.02.04 |