git&github remind

clone, pull and push with merge

Posted by ETHAN KIM on November 17, 2022 · 1 min read
Git

git, github

  • git : local 로그, 이력 관리
  • github : remote 로그, 이력 관리 및 공유
  • git, github 간 데이터 공유 시 자동으로 병합이 이루어짐
  • 서로를 다른 branch 개념으로 인식하여 병합


clone, pull

  • clone : remote repository 및 history 전체를 dump하여 local에 완전 동기화 (기존 local 이력은 사라짐)
  • pull : repository 및 history를 기존 local 작업 branch로 병합 (충돌할 경우 수정 필요)


push

  • 현재 local branch commit 이력을 remote repository 선택 branch로 병합
  • 기본적으로 fast forward merge 형태로 받아들임 (올리기 전 충돌 제거작업 필요)
  • fast forward merge : 갈라지기 전 까지의 history 일치 시 갈라진 branch를 head로 하여 병합
  • non fast 에러시 pull 또는 clone 등 history 동기화 후 충돌 제거한 뒤 다시 push


개념정리표