[Git] clone vs fetch vs pull

BnDC·2021년 9월 25일

Git

목록 보기
3/3

clone

git clone <repository 주소>

git clone = git init + git remote origin origin + git pull

github repository에서 local으로 새로 파일을 받아와 프로젝트 작업을 시작할 때 사용한다.




git fetch

git fetch origin master

github repository의 내용을 확인 하고 싶지만, local repository와 merge하고 싶지 않을 때 사용한다.

원격 저장소의 최신 이력을 확인 할 수 있다.

git log --decorate --all --oneline




git pull

git pull <repo shortname> <repository branch>
git pull origin master

git pull = git fetch + merge
github 최신의 소스를 local git에 가져와 병합해 준다.

github repository 작업 전, pull 해오는 습관을 들이자!

profile
“Life is C (Choice) between B (Birth) and D (Death).” - 인생은 B와 D사이의 C

0개의 댓글