목적


실습

  1. mkdir temp; cd temp

  2. git init

  3. git remote add origin2 [email protected]:exgs/github_test.git

  4. git fetch origin2 yunslee & git merge origin2/yunslee

    현재 local branch가 remote branch의 commit 으로 이동함, 즉 Working Directory에서 remote repository에 있는 파일과 폴더로 작업할 수 있음

    두 명령어를 합친 것이 git pull origin2 main 이다. git pull == git fetch + git merge


Advanced more

  1. git remote add origin3 [email protected]:exgs/github_test.git -t {branch_name}

    특정 branch만 remote에서 가져올 수 있음

  2. git clone —depth 을 통해 Shallow clone을 할 수 있다.


추가 22.6.16