작성완료

Git 핵심 명령어 정리
깃 명령어 요약: 원격 저장소 클론, 초기화, 로컬 브랜치 생성, 원격 연결, 파일 추가, 커밋, 업로드, 로컬 저장소 업데이트, 원격 파일 삭제 방법을 포함합니다.
깃 원격 저장소 가져오기
$ git clone https://github.com/UGKONG/workLog.git
깃 초기화
$ git init
깃 로컬 브랜치 생성
$ git branch -M main
깃 원격 연결
$ git remote add origin https://github.com/UGKONG/workLog.git
깃 파일 로컬 저장소 추가
$ git add . (전체파일)
$ git add -A (변경된 파일)
깃 커밋
$ git commit -m '메시지'
깃 업로드
$ git push -u origin main (처음업로드)
$ git push -f origin main (업로드)
깃 로컬 저장소 업데이트 (원격저장소 것으로 최신화)
$ git fetch
$ git reset –-hard origin/main
깃 원격파일 삭제
$ git rm –-cached -r 파일명
$ git rm –-cached -r . (전체파일 삭제)
커밋
$ git commit -m 'RESET'
업로드
$ git push