1. Git bash
# Windows
업로드할 폴더의 상위 폴더로 가서 우클릭 -> 'Open Git Bash here'
# Mac
업로드할 폴더의 상위 폴더로 가서 마우스 우클릭 -> '폴더에서 새로운 터미널 열기'
2. 원격저장소에 로드
- 깃 초기화
$ git init
- 깃헙 연동
$ git remote add origin {깃헙 repository 주소}
- 깃 스테이징 & 커밋
$ git add .
$ git commit -m "커밋 메시지"
3. master -> main branch 이동 (이미 main인 경우 패스)
- 현재 브랜치 확인
$ git branch
- master -> main branch 이동
$ git branch -m master main
$ git branch -m main
4. 원격저장소와 연결
- 원격저장소와 연결되어 있는지 확인
$ git remote -v
- git push
git push origin main
전체 코드
$ git init
$ git remote add origin {깃헙 repository 주소}
$ git add .
$ git commit -m "커밋 메시지"
$ git branch
// master -> main branch
$ git branch -m master main
$ git branch -m main
$ git remote -v
$ git push origin main
'Git & Github' 카테고리의 다른 글
[Git&Github] 자주 사용되는 명령어 정리 (0) | 2023.11.04 |
---|---|
[Git] 브랜치(branch) - git branch, switch, merge, cherry-pick (0) | 2023.10.02 |
[Git] 버전 관리(Version Control) - git init, add, commit, log, restore, revert (0) | 2023.09.11 |
[Git] 기본적인 리눅스 명령 (0) | 2023.09.10 |
[Git] 윈도우(Windows)에서 Git 설치 (0) | 2023.09.10 |