Github Repository를 생성하는 실습을 진행합니다.
https://github.com 에서 계정이 없다면 Sign up, 계정이 있다면 Sign in으로 로그인 합니다.

Github Profile
Your profile을 선택하여 나의 프로필로 이동합니다.
Github Repository 생성

생성할 레포지토리의 정보를 입력합니다.
이름만 입력하고, 공개 여부만 설정한 뒤에 진행해도 무방합니다.

Create repository 를 선택하여 Github Repository를 생성합니다.

Github Repository 연동 준비
현재는 Remote 환경(Github)에 올라온 내용이 없기 때문에 Local 환경(내 컴퓨터)에서 해당 프로젝트를 진행할 폴더에 git을 설정한 뒤 Remote에 Push 해야합니다.
Quick setup 설명의 커맨드를 살펴보겠습니다.

최초로 Local Repository를 생성하여 업로드하는 경우
git init 명령어로 git 환경 초기화를 한다.git commit -m “first commit” 명령어로 메시지와 함께 코드 변경을 커밋 한다.git branch -M명령어로 브랜치 이름을 main으로 변경한다.
-M 은 이름을 변경한다는 옵션 입니다.git remote add origin [email protected]:{유저 이름}/{Github repository 이름}.git 으로 Local Repository에 Remote Repository를 origin이라는 이름으로 등록합니다.git push -u origin main 명령어로 main 브랜치를 origin Remote Repository의 main에 push(업로드) 합니다.
-u 는 —set-upstream 명령어로 Local Repository에 origin을 원격 저장소로 등록한다는 의미 입니다.git push origin {브랜치 명} 으로 push 하면 됩니다.기존에 존재하는 Local Repository를 업로드하는 경우
git remote add origin [email protected]:{유저 이름}/{Github repository 이름}.git 으로 Local Repository에 Remote Repository를 origin이라는 이름으로 등록합니다.git branch -M명령어로 브랜치 이름을 main으로 변경한다.git push -u origin main 명령어로 main 브랜치를 origin Remote Repository의 main에 push(업로드) 합니다.Github Repository 연동
다음과 같이 프로젝트를 진행할 폴더를 생성하고 git을 초기화 합니다.

Readme를 생성한 뒤 커밋을 남기고 Remote Registry를 등록한 뒤에 push 합니다.

Github Repository에 업로드된 것을 확인할 수 있습니다.
