ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Git) Repository
    Git 2023. 3. 24. 01:14

    Local Repository 구성

    - Working Directory(작업공간): 실제 소스 파일, 생성한 파일 존재

    - Index(Stage): Staging area(준비영역)의 역할, git add한 파일 존재

    - HEAD: 최종 확정본, git commit한 파일 존재

    Local Repository 생성
    mkdir <name>
    파일 생성
    touch <file name>
    Git Add: Working Directory 에서 변경된 파일을 Index(stage)에 추가
    git add <filename>
    Git Commit: Index(stage)에 추가된 변경사항을 HEAD 에 반영 (확정)
    git commit -m "commit 에 대한 설명" <filename>

     

    Remote Repository 등록

    git remote add origin http://<username>:<token>@github.com/<repository>.git
    Remote Repository 정보 확인
    git remote -v
    Remote Repository에 변경내용 Push 하기
    Local Repository (HEAD) 에 반영된 변경내용을 Remote Repository 에도 반영하기 위해서는 Git Push 를 사용
    git push origin <branchname>
    Local Repository 에 Pull 하기
    Remote Repository 의 내용에 맞춰 Local Repository 를 갱신하려면 Git Pull 사용
    git pull origin <branchname>
    git clone: Remote Repository 복제
    git clone https://<username>:<token>@github.com/<repository>.git

    'Git' 카테고리의 다른 글

    Git) Tag  (0) 2023.03.28
    Git) Merge / Conflict  (0) 2023.03.28
    Git) Log / Diff  (0) 2023.03.28
    Git) Branch  (1) 2023.03.28
    Git) 버전관리 및 기본개념  (0) 2023.03.23

    댓글

binlog