Part 06. Git_Chapter 05. Remote Repository

수야·2023년 8월 2일
0

remote repository 복제하기

local을 생성하지 않은 상태에서 git clone명령을 통해 remote를 local에 복제 할 수 있음

git clone

폴더를 만들고
++ git init으로 해당 폴더를 초기화 하고
++ remote를 등록하고
++ remote의 내용을 pull하는 모든 과정을 git clone으로 할 수 있음

git clone https://<username>:<token>@github.com/<repository>.git

Branch

Default Branch

main or master??
local에서 생성하면 master
github에서 생성하면 main

수정은 가능!
그런데, 왠만하면 배포 되기 전에 아주아주 시작때 바꾸고 그 이후에는 바꾸지말자
팀원들이 헷갈려한다

branch 조회

git branch

local만 조회됨

remote를 조회하고싶다?

git branch -r

local이랑 remote 모두 조회하고 싶다?

git branch -a

branch 생성

git branch <branchname>

branch 이동

git checkout <branchname>

branch 생성 + 이동

git checkout -b <branchname>

만들고 push 해야 git hub 에도 나옴

bracnh push

git push origin <branchname>

branch 삭제_local

git branch -d <branchname>


그러나, 브렌치에 위치해 있으면서 해당 브렌치 삭제할라그러면 오류남
다른 곳으로 옮겨서 삭제해야함

branch 삭제_remote

git push origin --delete <branchname>

profile
수야는 코린이에서 더 나아갈거야

0개의 댓글