名称

svn add — 添加文件, 目录或符号链。

概要

svn add PATH...

描述

Schedule files, directories, or symbolic links in your working copy for addition to the repository. They will be uploaded and added to the repository on your next commit. If you add something and change your mind before committing, you can unschedule the addition using svn revert.

选项

--auto-props
--depth ARG
--force
--no-auto-props
--no-ignore
--parents
--quiet (-q)
--targets FILENAME

例子

添加一个文件到工作副本:

$ svn add foo.c 
A         foo.c

当添加一个目录,svn add缺省的行为方式是递归的:

$ svn add testdir
A         testdir
A         testdir/a
A         testdir/b
A         testdir/c
A         testdir/d

你可以只添加一个目录而不包括其内容:

$ svn add --depth=empty otherdir
A         otherdir

Normally, the command svn add * will skip over any directories that are already under version control. Sometimes, however, you may want to add every unversioned object in your working copy, including those hiding deeper. Passing the --force option makes svn add recurse into versioned directories:

$ svn add * --force
A         foo.c
A         somedir/bar.c
A  (bin)  otherdir/docs/baz.doc
…