svn import — 递归提交一个路径的拷贝到版本库
名称
svn import — 递归提交一个路径的拷贝到版本库。
概要
svn import [PATH] URL
描述
递归提交一个路径的拷贝到URL。如果省略PATH,默认是“.”。版本库中对应的父目录必须已经创建。
别名
无
变化
版本库
是否访问版本库
是
选项
--message (-m) TEXT
--file (-F) FILE
--quiet (-q)
--non-recursive (-N)
--username USER
--password PASS
--no-auth-cache
--non-interactive
--force-log
--editor-cmd EDITOR
--encoding ENC
--config-dir DIR
--auto-props
--no-auto-props
--ignore-externals
例子
这会导入本地目录myproj到版本库的 根目录:
$ svn import -m "New import" myproj http://svn.red-bean.com/repos/test
Adding myproj/sample.txt
…
Transmitting file data .........
Committed revision 16.
这将本地目录myproj导入到版本库的trunk/misc,trunk/misc在导入之前不需要存在—svn import会递归的为你创建目录:
$ svn import -m "New import" myproj \
http://svn.red-bean.com/repos/test/trunk/misc/myproj
Adding myproj/sample.txt
…
Transmitting file data .........
Committed revision 19.
在导入数据之后,你会发现原先的目录树并没有纳入版本控制,为了开始工作,你还是要运行svn checkout得到一个干净的目录树工作拷贝。