내밥줄/프로그래밍

CVS 사용법 요약

jjoell 2008. 12. 30. 16:04

 

1. 프로젝트 관리자의 CVS 사용 방법(linux에서 설정)

1.1 CVS 초기화
 - 사용 계정 : root
 - CVS 설치 디렉토리 : /home/cvs
 - CVS 초기화 명령
  #cvs -d /home/cvs init

1.2 CVS 사용자 권한 부여
 - 사용 계정 : root
 - CVS 설치 디렉토리의 group를 cvs로 바꾼다.
  #chgrp -R cvs /home/cvs
 - CVS 그룹에 속한 개발자가 사용하도록 권한을 바꾸어 준다
  #chmod ug+rwx /home/cvs /home/cvs/CVSROOT
  #chmod -Rf ug+rwx /home/cvs/${project_name}
 - CVS를 사용하기 위한 개발자의 그룹을 cvs로 변경한다.
  /etc/group 파일에서 cvs groupid를 확인한후 /etc/passwd에서 사용자 계정의 groupid를 바꾼다.
  (ex) cvs groupid가 516인 경우에 xxx 계정을 갖는 개발자가 cvs를 사용할 경우
   /etc/passwd 파일에서 다음과 같이 바꾸어 준다.
   xxx:x:100:516::/home/xxx .......

1.3 CVS 개발자 환경파일에 CVSROOT 설정
 - 사용 계정 : 각각의 개발자 계정
 - bash 인 경우 .bash_profile 다음과 같이 추가한다.
  export CVSROOT=/home/cvs

1.4 프로젝트 또는 사용 모듈을 버젼관리 하기 위해 /home/cvs에 넣는 방법
 - 사용 계정 : 각각의 개발자 계정
 - 프로젝트가 존재하는 디렉토리 내에서 다음과 같은 명령을 사용하는데 여기서는 /work/BcN 임.
 - #cvs import -m "메시지 이름" $project_module_name $vender_tag $release_tag
  (ex) cvs import -m "BcN Access Node" BcN alphons start

2. 개발자의 CVS 사용 방법(linux에서 사용)

2.1 CVS 개발자 환경파일에 CVSROOT 설정
 - 1.3과  동일

2.2 /home/cvs에 존재하는 BcN 모듈을 개발자 디렉토리로 가지고 오기(checkout)
 - 개발자가 작업을 원하는 디렉토리로 이동한후 다음과 같은 명령을 사용한다.
 - #cvs chechout BcN
 - #cvs co -d $work_dir BcN

2.3 개발자가 작업한 내용 저장하기(commit)
 - hello.c를 변경한 경우
 - hello.c가 존재하는 디렉토리에서 다음과 같은 명령을 수행한다.
 - #cvs commit -m "인사말 추가" hello.c

2.4 /home/cvs에 존재하는 BcN 모듈중 변경된 것만 가지고 오기(update)
 - 개발자가 작업을 원하는 BcN내의 원하는 디렉토리로 이동한후 다음과 같은 명령을 사용한다.
 - #cvs update
 - #cvs -n up
 - #cvs -n -q up (-q flag is a less emphatic version of -Q. it suppresses the messages we probably don't want, while allowing certain, more useful messages to pass through)
 - #cvs update -P (repository 디렉토리가 삭제된 경우에, working 디렉토리에도 적용하고 싶을 때 사용)

2.5 파일 및 디렉토리 추가 삭제 방법(add/delete)
 - 개발자가 원한는 디렉토리나 파일을 생성한 후 다음과 같은 명령을 사용한다.
 - test.c를 생성을 원할경우
  #cvs add test.c  --> 개발자 내의 cvs 파일 설정 변경
  #cvs commit -m '테스트 파일' test.c  --> 개발자 cvs 정보와 /home/cvs 정보 일치 시키는 과정
 - 삭제할 경우에는 추가할 경우와 동일하게 하되 add 대신 delete사용한다.

2.6 작업 기록을 열람(log)
 - 해당 파일에 대한 작업 내용을 보고 싶을 경우 다음과 같은 명령을 사용한다.
  #cvs log test.c
  #cvs status test.c
  #cvs status -v test.c

2.7 CVS에서 새로운 디렉토리 checkin 하는 방법
 - 개발자가 checkin하기를 원하는 디렉토리의 상위 디렉토리로 이동한후 다음과 명령을 수행한다.
  #cvsadd.py -t $dir_name
 [grsong77@server15 Thales]$ cvsadd.py -t ./syscommon/smg/vapi_lib_2.7.0

2.8 commit 시 up-to-date 문제 발샐시 해결 방법 (update 버젼이 달라 문제 발생)
 - cvs update -dPA 한후 다시 commit하면 해결됨

2.9 파일 비교 방법
 - Version 비교
  #cvs diff -r $Ver1 $ver2 $file_name
  #cvs -Q diff -c -r $Ver1 $Ver2 $file_name

2.10 과거 버젼으로 교체하기
 - #cvs update -p -r 1.3 hello.c (-p means to send the results of update to standard output instead of to files)
 - #cvs -Q update -p -r 1.3 hello.c (-Q means "quietly"-that is, suppress all diagnostic output)
 - #cvs -Q update -p -r 1.3 hello.c > hello.c ( old version 가져 오기)
 - #cvs ci -m "reverted to 1.3 code" hello.c
 - #cvs up -j 1.4 -j 1.3 hello.c  (1.3과 1.4의 차이를 hello.c 로 merge함 : 1.3이 hello.c 로 들어감)
 - #cvs ci -m "reverted to 1.3 code" hello.c

2.11 바이너리나 키워드 파일 추가
 - #cvs add -kb filename (you have to tell CVS to turn off both keyword expansion and line-ending conversion. To do so, use -kb: )
 - #cvs add -ko filename (you may wish to disable just the keyword expansion. That's done with -ko)

3. 개발자의 CVS 사용 방법(Windows에서 WinCvs 사용)

3.1 WinCvs 설치
 - 가급적이면 WinCvs 2.0.0.2 상위 버젼만 사용
 - wincvs_setup.exe와 cvsnt_setup.exe를 설치한다.
 - 설치방법 생략

3.2 WinCvs가 linux Server에 존재하는 pServer와 연결되는지 확인 하는 방법(login)
 - winCvs를 실행한후 [Admin]-[login]을 선택한후 [login Settions] 탭 안의 CVSROOT에서 다음과 같이 설정한다.
 - :pserver:$user_id:$user_passwd@$server_ip_address:$directory
 - 서버에 xxx계정과 xxx00 패스워드를 갖는 개발자가 login 할 경우
  (ex):pserver:xxx:xxx00@192.168.1.8:/home/cvs

3.3 기타 사용 방법
 - import, checkout, commit, update, add/delete, log 등의 명령의 개념은 server에서 사용하는 개념과 동일하다.
 - 첨부된 문서를 참조하고 해당 명령을 사용할 경우 CVSROOT란에 3.2와 같은 넣어 주면 됨


4. branch 사용법
4.1 branch 생성 방법
 # cvs tag V2_2
 # cvs tag -b V2_2_1
4.2 생성된 branch 가져오는 방법
 # cvs co -r V2_2_1 $prj_name
 ==> branch의 가장 최신 파일을 가지고 옮
4.3 수정된 파일 저장 방법
       //# cvs up -j V2_2 $file_name
 # cvs ci -m "description" $file_name
4.4 tag 정보 보는 방법
 # cvs log $file_name
 # cvs status -v $file_name

 

=========================================
samba start
==========================================

/etc/init.d/smb restart