관성적으로 git clone
repository를 가져오는것에서 탈피하여, 깃허브의 동작을 조금 더 잘 이해하기 위함.
결국 아래 그림을 잘 이해하고자하는 목적을 가짐
mkdir temp; cd temp
git init
git remote add origin2 [email protected]:exgs/github_test.git
git log --all
으로 확인해보기git remote show` &
git remote show origin2`` 로 확인해보기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
git remote add origin3 [email protected]:exgs/github_test.git -t {branch_name}
특정 branch만 remote에서 가져올 수 있음
git clone —depth
을 통해 Shallow clone을 할 수 있다.
git remote add origin2 [email protected]:exgs/github_test.git
로 불러 올 수 있는 경우는 ssh key가 github에 등록되어있는 경우이다.git remote add origin2 <https://{token}@github.com/exgs/github_test.git
> 로 remote 리파짓토리를 붙일 수 있다.git remote add origin2 <https://{user}:{password}@github.com/exgs/github_test.git
> 로 불러 올 수 있었겠다.