깃허브 초기설정, 기본 사용방법 정리!!
깃 사용자 설정
git bash 실행
git config --global user.name "jjjjjeongWon" << 사용자 이름설정
git config --global user.email "jjjjjwon21@gmail.com" << 사용자 이메일 설정
git config --list << 재대로 기재됬나 확인
git init < 시작
git add . < 뭘올리겠냐?? ( . ) 점은 전체를 의미 (index.html) index.html 을 올리겠다.
git status < git 상태 확인
git commit -m "first commit" < (코멘트달기)
git remote add origin https://github.com/jjjjjeongwon/Algorithm-JS.git < 깃이랑 vs code 랑 연결
git remote -v << 연결 확인
git push origin main << Github로 올리기 (master 브릿지로 올리겠다!)
git add . < 전체다 올리겠다.
git commit -m "first commit" < "first commit" 이라고 메세지 남김
git push origin master << Github로 올리기 (master 브릿지로 올리겠다!)
- 깃헙 복제하기
cmd > 다운받을 폴더로 이동
git clone 깃헙주소 폴더이름
cd 폴더이름
code .
- 깃헙 새브랜치 만들기
git add .
git commit -m "first commit"
git checkout -b 브랜치 이름
- 깃 메인과 동기화하는 방법
git commit -m "second commit" << 시작하기전에 커밋 (저장)
git pull origin master << pull 로 main과 동기화 해줌 (메인코드 땡겨와서 합침)
git push origin master << push