[PR]tDl:5ltp]E参I

付録 A. CVS コマンド

目次
add
admin
checkout
commit
diff
export
history
import
log
rdiff
release
remove
rtag
status
tag
update

add

リポジトリに新しいファイル、ディレクトリを作成します。 実際にリポジトリに反映されるのは、commit 後です。

加えたいファイル、ディレクトリは作業ディレクトリに存在している 必要があります。

shimaki:~/tmp/hello $ ls
CVS/ hello.c README ChangeLog
shimaki:~/tmp/hello $ cvs add README ChangeLog

add を利用すると commit 前の remove を取り消すことができます。

shimaki:~/tmp/hello $ ls
CVS/ hello.c README ChangeLog
shimaki:~/tmp/hello $ rm hello.c 
shimaki:~/tmp/hello $ cvs remove hello.c
cvs remove: scheduling `hello.c' for removal
cvs remove: use 'cvs commit' to remove this file permanently
shimaki:~/tmp/hello $ cvs add hello.c
U hello.c
cvs add: hello.c, version 2.1, resurrected
shimaki:~/tmp/hello $ 

通常は、commit 時にログメッセージを入力するこになりますが、 -m オプションを使用すれば add 時にログメッセージを入力することができます。

shimaki:~/tmp/hello $ cvs add -m 'インストールドキュメント作成' INSTALL
cvs add: scheduling file `INSTALL' for addition
cvs add: use 'cvs commit' to add this file permanently
shimaki:~/tmp/hello $ 

バイナルファイルをリポジトリへ加えたい時は、-kb オプションを利用します。

shimaki:~/tmp/hello $ cvs add -kb -m 'バイナルファイルです' binary
cvs add: scheduling file `binary' for addition
cvs add: use 'cvs commit' to add this file permanently
shimaki:~/tmp/hello $ 


[PR]DoCoMo娑枝KI:AE^ffI