본문 바로가기
개발 도구/Git

GitHub(깃허브) 사용법 - 1

by wlsghks4043 2021. 7. 5.
  • Git 설치
    • https://www.git-scm.com 를 통해 window 버전 다운르도 진행
    • 옵션은 default 값에서 변경하지 않음

 

  • Github Repositories에 들어가서 New 이용 repository 생성
    • "https://github.com/<ID>/<repository_name>.git" 형식으로 되어 있는 repository 주소 복사
    • Repository와 연결하고 싶은 폴더에서 오른쪽 마우스 클릭하여 "Git Bash Here"로 Git 실행
    • git config --global user.name <github ID>
    • git config --global user.email <github email> 설정

 

  • git clone "https://github.com/<ID>/<repository_name>.git" 이용 repository 다운로드
    • .git 파일이 다운되는 것을 확인할 수 있음

 

  • 새로운 파일 (test.txt)를 생성하여 repository에 업로드 진행
    • git add test.txt or git add .
    • git commit -m "commit [test.txt](commit 내용)"
    • git push or git push -u origin master

 

  • git push에서 멈춤현상이 발생하는 경우 해당 폴더에서 cmd 실행
    • git push or git push -u origin master
    • 1번 인터넷연결 승인을 통해 로그인하여 진행 후 다시 Git Bash를 통해 push 진행

 

  • 원하는 파일이 repository에 업로드 된 것을 확인
    • 밑에 보이는 그림과 같은 방법으로 파일을 Github에 업로드 하는 방법을 알아보았음
    • 다음 장에는 더 코드를 수정하여 업로드하는 방법들을 추가할 예정

 Git의 기본 매커니즘