티스토리 뷰

etc

git 설명서

shannon. 2013. 12. 31. 14:18
반응형

http://rogerdudler.github.io/git-guide/index.ko.html


 


그리고 아래 메일은 일전에 공유된 메일인데요


우리가 devel/osp/master를  사용하기 전이기 때문에


(Master는 현재 사용하지 않는 브랜치이므로)


Master를 devel/osp/master로 치환하셔서 보시면 됩니다.


 


 


git 룰)


1. master branch에서는 개발을 하지 않습니다.


2. branch는 작업 단위로 만들어 사용합니다.


2.1 작업이 완료되면 바로 삭제 합니다.


(scp -p -P 29418 <_ID>@165.213.149.219:hooks/commit-msg .git/hooks/  <= 이것을 해주었다고 가정) 


 


[기본, 시작]


1. master branch을 최신 상태로 업데이트 한다.


(master)$git pull


 


2. 작업할 branch를 만든다.


(master)$git checkout --b ‘branch_name’


 


3. 수정을 한다.


(branch_name)$vi CMakeLists.txt


(branch_name)$git add CMakeLists.txt


(branch_name)$git commit –s -m “Add new_file.cpp to CMakeLists.txt”


 


4. 리뷰를 올린다.


(branch_name)$git push orgin HEAD:refs/for/master


 


5. 리뷰를 받는다. ( 리뷰 수정 사항 발생시 아래 A.1 으로 이동)


 


6. 리뷰완료 후 아래 명령어 실행 하면 GNU Edit 창이 뜨면 아래를 작성해 준다 (주의 SCM권장 포멧과 다를 수 있음).


git tag -a submit/master/`date --utc +%Y%m%d.%H%M%S`

 

 


7. git push --tags origin HEAD:refs/for/master a new tag로 tag가 바뀌는 것을 확인 (remote rejected 하단 error는 무시)


  


8. Gerrit page에서 패치를 submit 한다.


 


9. master branch를 최신 상태로 업데이트 한다(7에서 submit된 내용을 로컬의 master branch에 반영).


(branch_name)$git checkout master


(master)$git pull


 


 


10. 작업이 완료된 branch 삭제


(master)$git branch --d branch_name


 


[Comment 적용] :4 이후에 commit 내용을 수정 반영 할 필요가 있을 때


A.1. 수정을 한다(commit 때 --amend 옵션을 주어 기존 commit에 수정 사항을 반영한다).


(branch_name)$vi CMakeLists.txt


(branch_name)$git add CMakeLists.txt


(branch_name)$git commit --amend


 


A.2. 다시 리뷰를 올린다


(branch_name)$git push orgin HEAD:refs/for/master


 


[Conflict 해결] : 5에서 conflict가 발생하여 submit이 실패했을 경우


 


B.1. master branch를 최신 상태로 업데이트 한다.


(branch_name)$git checkout master


(master)$git pull


 


B.2 작업 branch를 최신 상태로 rebase 한다. (merge를 해야할 상황이 생기면 잘 해결해 줍니다.)


(master)$git checkout branch_name


(branch_name)$git rebase master


 


B.3 다시 리뷰를 올린다.


(branch_name)$git push orgin HEAD:refs/for/master


 


 


자주 자용하는 git 명령어 (알아서 공부하세요)


git status


git checkout –


git checkout


git branch


gitk


git stash


git stash pop


git diff file 


 



반응형

'etc' 카테고리의 다른 글

test  (0) 2014.01.04
test  (0) 2014.01.04
git config  (0) 2013.12.31
test32123  (0) 2013.12.22
c++ reference site  (0) 2013.11.18
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/07   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
글 보관함