-
[github] 원격 저장소에 로컬 저장소 업로드 하기개발 2023. 7. 29. 20:53
처음에는 원격 저장소와 로컬 저장소라는 말이 헷갈렸는데요,
단순히 깃허브 서버 저장소와 내 컴퓨터의 저장소를 일컫는 말입니다. ㅎㅎ
새로운 원격 저장소를 만들고 내 컴퓨터의 디렉토리를 업로드하는 과정을 진행해보겠습니다.
1. 레포지토리 생성
저장소 이름을 입력하고 Create repository버튼을 누릅니다.
레포지토리에 들어가서 .git으로 끝나는 원격 저장소 주소를 복사해둡니다.
2. 로컬 저장소 설정 및 업로드
업로드할 디렉토리에서 다음과 같은 명령어를 입력합니다.
$ git init $ git config user.name "사용자 이름" // 모든 로컬 저장소에 적용하려면 config 뒤에 --global 붙이기 $ git config user.email "이메일 주소" $ git remote add origin {복사한 원격 저장소 주소}
추가한 파일들을 업로드합니다.
git add . // 현재 폴더의 모든 파일을 스테이징 영역에 추가 git commit -m "initial commit" // 스테이징 영역의 파일들을 지역 저장소에 추가 git push origin main //지역 저장소의 파일들을 원격 저장소에 업로드
원격 저장소에 업로드 된 것을 확인할 수 있습니다!
참고 문서
https://www.yes24.com/Product/Goods/103525595
'개발' 카테고리의 다른 글
초보 개발자를 위한 프로젝트 기본 프로세스 (0) 2023.07.27