Notice
Recent Posts
Recent Comments
Link
«   2025/05   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Tags
more
Archives
Today
Total
관리 메뉴

사적인 블로그

[git] 로컬 폴더와 github repository 연결, commit하기 본문

TIL

[git] 로컬 폴더와 github repository 연결, commit하기

DevYeri 2025. 2. 19. 19:03

간단하지만 맨날 찾아보기 귀찮아서 정리하는 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 브랜치에 머지해주면 됩니다.

 

 

 

끗!