[etc] git

etc 2012. 11. 15. 18:52








사용법(생성부터 발행까지)


git clone [URL]


git submodule init
git submodule update

git checkout [branch名]   : 브랜치 지정
git branch   : 브랜치 확인

git commit [files ..] -m "comment"  : commit
git push origin [branch]


-----------------------------
사용법

git diff    : 변경비교
git add [file ..] 
git status
git log -[num]  : 로그 확인 
git checkout -- [file] : 변경을 취소하고 이전 커밋 상태로 돌림.

-----------------------------
파일삭제

xcode에서 trash로 보내지말고, reference만 제거한후
git rm [file]  : 파일 한개
git rm -r [path] :  디렉토리 전부
한 후,

git commit -a -m "comment"
git push origin [branch]
-----------------------------
브랜치 만들기

git branch [branch名]
git checkout [branch名]
git branch



stash : 완결되지 않은 작업을 저장.


#현재 작업을 저장해두고 branch를 head로 돌린다.(git reset --hard)
git stash save

#저장되어 있는 stash들 보기
git stash list

#stash를 꺼내와서 적용
#stash들은 stack에 저장된다. 따라서 가장 최근에 save한 stash가 현재 branch에 적용된다.
git stash pop

#git stash pop 과 비슷한 명령어지만 stash list에서 삭제하지 않는다는 점이 다르다.
git stash apply

#필요 없는 stash를 삭제
git stash drop

#전체 stash list를 삭제

git stash clear



ref : http://www.dreamy.pe.kr/zbxe/CodeClip/157790










Posted by tenn
,