ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Repository 셋업
    개발 관련/협업 2020. 9. 25. 18:28

     

    2가지의 경우로 나눠질 수 있다

     

    1. 파일이 존재하지 않을

    2. 파일이 로컬 시스템에 존재할

    a. 파일 추가 (리모트 repository 연결 X 또는 O)

    b. 덮어쓰기 (리모트 repository 연결 O)

     


     

    존재하지 않을 경우

    1. 리모트 repository 생성

     

     

    2. 생성된 Repository를 로컬시스템에 복제(clone)

    git clone <Repository 주소>     → http 또는 ssh

     

     


     

    존재할 경우

    1. 리모트 repository 생성

     

     

    2-a. 생성된 repository에 로컬 파일 추가

    git init

     

    git add .

     

    git commit -m <'메세지내용'>

     

    git remote add <단축이름> <Repository 주소>      → 로컬 Git repo와 리모트 repo 등록 및 연결

     

    ※ 만약, 생성된 Repository에 이미 파일(예. README.md)존재한다면 먼저 pull 하기!

    git pull origin master --allow-unrelated-histories

     

    git push -u origin --all

     

    → 리모트 repo = 리모트 repo + 로컬 repo

     

     

    2-b. 생성된 repository에 덮어쓰기

    git remote set-url <단축이름> <생성된 Repository 주소>    → 로컬 Git repo와 리모트 repo 변경 및 연결

     

    git push -u origin --all

     

    → 리모트 repo = 로컬 repo

    '개발 관련 > 협업' 카테고리의 다른 글

    GIT Fork Vs. Clone  (0) 2021.03.01
    Branch Workflow  (0) 2020.09.25
    Gitflow 워크플로  (0) 2020.09.24
    Git 101  (0) 2020.09.23
Designed by Tistory.