[Git & GitHub] 5. GitHub에 파일 올리기(Push)
로컬 저장소에서 commit 후 원격 저장소인 GitHub에 파일을 올릴려면 push 명령어를 사용한다.
1. 원격 저장소 만들기
우선 GitHub에 원격 저장소를 만들어야 한다.
1. GitHub에 들어가서 프로필 -> New repository 클릭.

2. Repository name에 저장소 이름을 작성, Description 에 설명 작성 후 Create repository 클릭

3. 원격 저장소가 생성 됐다.
아래 https://github.com/WelchsBanana/GitExample.git 가 저장소의 주소다.

2. 원격 저장소에 파일 올리기
저장소 생성 했으니 로컬 저장소의 파일을 GitHub에 올려보자.
1. 생성한 저장소의 주소를 복사 버튼을 눌러 복사 해준다.
2. 로컬 저장소 폴더로 와서 Git Bash Here을 클릭한다.

3. git 저장소에게 Github 저장소 주소 알려줘야 한다.
git remote add origin 적어준 후 띄어쓰기 한번 하고 -> 우클릭 -> Paste

만약 "error: remote origin already exists. "가 뜬다면 아래 링크 타고 들어가서 해결
https://goodprogramer.tistory.com/53
[Git] error: remote origin already exists 에러 해결
error: remote origin already exists 에러 해결 방법. 이 에러는 다른 원격 저장소와 이미 연결되어 있어서 연결을 할 수 없다는 거다. 이럴 땐 로컬 저장소와 원격 저장소의 연결을 끊고 다시 원하는 주소
goodprogramer.tistory.com

git push origin master


7. Authorize git-ecosystem 클릭.


9. GitHub 자신의 원격저장소에 가서 새로고침 해보면 파일이 잘 올라온 걸 확인 할 수 있다.
