부캐/기타

Git/Git hub 버전관리 입문

Jeorney 2022. 7. 5. 11:29
300x250

Git 버전관리

Git  버전관리 기본 동작

 

Git 버전관리를 위한 기본 명령어

Git 로컬 리파지토리 생성

git init

Add 

git add <파일명> # Git 로컬서버에 추가(staged 상태로 변경)

Checkout

git checkout -- <파일명> # Git 로컬서버에 (unstaged 상태로 변경)

Commit

git commit -m '<커밋할 메세지>'

Push

git push -u origin master # 원격저장소에 올리기

Git clone

git clone <원격repository 경로> #원격 repository 이름과 동일한 폴더가 생성되면서 복제됨
git clone <원격repository 경로> . #현재 폴더에 원격 repository의 파일들이 복제됨

 

참고할 명령어

Git Status 확인

git status

Git log

git log 
git log -2 # 갯수만큼의 최근커밋을 보여줌

Git repository의 브랜치 목록 조회

git branch -v # 로컬 브랜치 목록 확인
git branch -r # 원격 브랜치 목록 확인
git branch -a # 모든 브랜치 목록 확인

Git remote Repository 조회

git remote -v

 

Git Branch 관련 참고 페이지

https://nvie.com/posts/a-successful-git-branching-model/

300x250
반응형