Skip to content
kmkim edited this page Jul 16, 2013 · 4 revisions

git init

git add staging

git commit -m "[messages]"

git status

git log git log --pretty=oneline

git branch <branch_name>

git checkout <branch_name>

git tag <tag_name> <branch_name>

git rebase <another_branch_name>

git branch -d <branch_name> 브랜치 삭제

git add -i 대화형 추가

git add -p 패치 모드로 추가

git diff unstaged or not committed 변경 사항 표시

git diff --cached staged 변경 사항 표시

git diff HEAD 모든 변경 사항

git mv <before_file_name> <after_file_name> 파일 이름 변경 or 이동

.gitignore

.git/info/exclude 지역(로컬) 저장소에서만 해당 파일 무시

git branch -m <before_branch_name> <after_branch_name> 브랜치 이름 변경

git branch <branch_name> 브랜치 생성

git checkout -b <new_branch> <from_branch> 기존에 있는 브랜치에서 새로운 브랜치를 생성하고 이 브랜치를 체크아웃

git merge <branch_to_be_merged> 현재 브랜치에 해당 브랜치의 내용을 머지한다.

git merge --squash <branch_to_be_merged> 하나의 커밋으로 머지한다.

git cherry-pick <hash값> 특정 커밋을 합친다.

git cherry-pick -n <hash값> 합치기는 하지만 커밋하지는 않는다.

git mergetool 충돌시 머지 툴 사용

git branch -d <branch_name> 브랜치 삭제한다.

git branch -D <brach_name> 브랜치를 강제로 삭제한다.

git branch -m <before_branch_name> <after_branch_name> 브랜치 이름을 변경한다.

Clone this wiki locally