Github

CS File·2024년 12월 7일

GIT

목록 보기
7/10

Github

git repository를 위한 호스팅 플랫폼

  • 클라우드에 git repository를 저장해 git을 이용한 협업을 돕는 웹 서비스

Remote

github에 있는 repository의 주소

Remote Tracking Branch

remote repository가 가리키는 commit

Push

local repository에서 remote repository로 변경사항을 올림

Fetch

remote repository에서 local repository로 변경사항을 가져옴

  • 정보를 가져오되 작업중인 파일엔 영향이 없음

Pull

remote repository에서 working directory로 변경사항을 가져옴

  • 정보를 가져와 working directory에 통합(fetch와 merge를 합친 느낌)

Github Gists

코드 조각을 간단히 공유하는 방법

  • 짧은 코드, 메모 등을 기록하고 공유할 수 있음

Github Pages

github를 통해 정적 웹 페이지를 호스팅함

명령어

git clone https://www.a.com/			// a.com에 있는 repository를 컴퓨터로 가져오기
git remote -v							// 설정되어있는 remote를 표시
git remote add origin https:www.a.com/	// a.com을 remote로 설정
git push origin testbranch				// test branch를 remote로 push
git push orgin a:b						// a라는 local branch를 b라는 remote branch로 push
git push -u a b							// b라는 local branch를 a라는 remote branch로 연동
git push -u origin a:b					// a라는 local branch를 b라는 remote branch로 연동
git branch -r							// remote repository의 branch 조회
git branch a							// 연결이 되어있을 때, remote의 a branch와 연결된 a branch생성
git fetch origin a						// remote에서 local로 a branch 변경사항 가져오기
git pull origin a						// remote에서 local로 a branch 변경사항 통합
profile
공부 내용 정리

0개의 댓글