-
Notifications
You must be signed in to change notification settings - Fork 10
02. git 02
Dongwook Lee edited this page Jun 3, 2013
·
3 revisions
- 실습해보고 안되는 것은 (issue로) 공유하자
- github issue/confluence wiki 활용
- 진행 요약
- 복습 + alpha
- git log --pretty=oneline
- --graph
- git log -p -2
- git log
- 현재 브랜치의 이력
- staging + repo
- git rm
- git mv
- git rm + git add
- TODO: checkout이 안되는 경우
- stage에 (변경) 내용이 있는 경우
- git diff? --cached?
-
git diff --word-diff
- [- -]{+ +} 형태로 표시됨
-
- git log --pretty=oneline
- configs
- git config --global user.name "Sungchul Park"
- git config --global user.email
- git config --global core.editor vim
- git config --global merge.tool vimdiff
- git config --list
- aliases
- alias.last "log -p -1 HEAD"
- alias.graph "log --all --graph --pretty=oneline --abbrev-commit --decorate"
- .gitignore
- remote 관리
- git clone을 하면 origin이라는 remote가 추가됨
- git remote add
- github에서 new project
- git remote -v
- .git/config 에서 확인 가능
- trace branch
- branch 별로 해당 remote가 다를 수도 있다
- checkout
- to working dir
-
- git checkout ${changeset}
- 1-1. git checkout ${branch}
- branch는 commit object에 대한 reference이다
- branch를 '가지 전체'라고 그대로 생각해서는 곤란하다
-
- git checkout -- ${filename}
-
- staging 안하고 checkout (X)
- cf. git diff는 어떤 area와 관계 되어 있는가?
- to working dir
- reset
- staging area reset
- 연습: 파일 내용을 변경한 후 이전 커밋으로 돌아가보자
- staging area가 변하므로 diff가 잘라짐
- 참고: 내용 변경 후 checkout 하려면 stage 여부를 (날아갈까봐) 살핀다.
- 연습: 파일 내용을 변경한 후 이전 커밋으로 돌아가보자
- git reset
- index를 중심으로 동작
- --hard:
- --soft: index 조차 건드리지 않는다
- --mixed:
- staging area reset
- 숙제
- merge
- rebase
- 복습 + alpha