티스토리 뷰

Git

Git 기본 사용법

Seogineer 2020. 12. 25. 16:22

Git 작업 흐름

  1. Working directory(작업 디렉토리): 실제 소스 파일들 존재. add 명령으로 Stage로 보냄.
  2. Index(Stage): 준비 영역. commit 명령으로 HEAD로 보냄
  3. HEAD: 최종 확정본

사용방법

local에 폴더를 먼저 만든 경우

$ git init    //저장소로 만들고 싶은 폴더로 이동해서 명령 실행
$ git add *
$ git commit -m "commit에 대한 설명"
$ git remote add origin <원격 서버 주소>    //github에서 미리 repository를 만든다.
$ git push origin master

 

github에 저장소를 먼저 만든 경우

$ git clone <원격 서버 주소>    //github에서 미리 repository를 만든다.
$ git add *
$ git commit -m "commit에 대한 설명"
$ git push origin master

참조

https://rogerdudler.github.io/git-guide/index.ko.html

댓글
Total
Today
Yesterday
링크
Apple 2023 맥북 프로 14 M3, 스페이스 그레이, M3 8코어, 10코어 GPU, 512GB, 8GB, 한글