본문 바로가기

Tip

github의 repository에 파일 업로드하는 방법

 

1. Github 웹사이트 계정 생성

 

2. 업로드할 본인의 repository 확인

 

 

3. 명령 프롬프트를 열고 'cd 경로' 입력

 

4. 'git init' 입력

 

5. 'git add .' 입력

 

6. 'git commit -m "설명"' 입력

 

6-1. 만약 이메일과 이름을 설정하라는 error가 발생하는 경우, 아래와 같이 작성

git config --global user.email "이메일"

git config --global user.name "이름"

 확인이 필요한 경우, git status

 

7. 'git remote add origin repositoryURL' 입력

URL은 여기서 가져오면 됨

 

8. 'git push -u origin 'branch명' 입력

 

9.  repository에서 업로드를 확인.

★ 업데이트 시, add . → commit → push로 단축입력 가능.

★ 새로운 branch에 업데이트 시,

git checkout -b "branch이름" add . → commit → push -u origin 'branch이름' 작성.