[Git]<git 협업 2> Git Remote 저장소 등록(remote add, push)

1. git remote add : local 저장소에 remote(원격) 리포지토리 url로 연결

$ git remote add <local에서 remote 저장소 주소를 대신할 name> <github 저장소 url>
// ex) git remote add origin git@github.com:AngryDoggaebi...

name은 일반적으로 origin.

url : github 저장소 -> code -> SSH

 

 

2. git push : remote 리포지토리에 local에서 commit한 내용을 업로드 

$ git push <remote name> <branch>
//ex) git push origin main

remote name은 1번에서 설정한 name.

branch는 github 저장소(remote 저장소)의 branch. 현재 github의 기본 branch는 main.

(git의 기본 branch는 master로 되어 있으므로 git을 설치할 때 바꿔주는것이 좋다. git 설치 추후 업로드 하기.)