git bash 사용하기

ilysm·2023년 8월 29일
  1. 해당 폴더로 가서 우클릭 후 git bash here 설정

  2. 깃 브랜치 메인으로 설정

git config --global init.defaultBranch main
  1. 깃 init 시키기
git init
  1. 현재 폴더에 있는 파일들 확인
git status

4-1. readme.md 을 pull 먼저 해야함

git remote add origin [repository 주소]
git pull origin main
  1. 로컬저장소에 파일 올려줌.
git add [파일명 or 폴더명]

특정파일 업로드는 add [파일명 or 폴더명]

모든 파일 push하기 위해서는 파일명대신 . 해줌.

  1. push 및 커밋
git commit -m "[Push 메세지명]"

push시 원하는 메세지를 등록하고 commit 해줌

  1. 올릴 깃의 repository주소를 복사

    나만의 저장소 주소( https://github.com/이름/저장소.git) 부분 복사

  1. 저장소 연결
git remote add origin [repository 주소]
  1. 로컬저장소 원격저장소로 연결
git remote -v
  1. 아까 commit 해두었던 파일들을 원격저장소에 올림
git push origin main
profile
한걸음씩 배워나갑니다

0개의 댓글