콘솔워크

GitHub 최초 원격 저장소에 Push 하기 (Branch는 Main으로) 본문

프로그래밍/git

GitHub 최초 원격 저장소에 Push 하기 (Branch는 Main으로)

콘솔워크 2021. 7. 24. 07:24
반응형

1. 먼저 Github에서 레파지토리를 만든다.

2. 자신이 생성한 소스에서 README.md파일을 만들고 git init부터 시작한다.

 

git 코드 예시) 

echo "# crwal_naver_posts" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/alalshow/crwal_naver_posts.git
git push -u origin main

원격 레파지토리의 이름은 "crwal_naver_posts" 이다.

 

자신의 원격레파지토리 이름에 맞게 세팅하면된다.

반응형