|
目录
来源:http://trac.seagullproject.org/wiki/Installation/FromSVN Subversion简介如果你想利用项目最新开发的特性,你可以到我们的SVN服务器取得代码的最新版本。 请注意:像SVN知识库上的任何代码一样,这个版本也可能包含bugs,但是大多情况下它是很稳定的… 如里你想提交补丁或译文,请始终使用SVN的最新版本: 如何取得最新的SVN版本:要取得bugfix的最新代码,请使用bugfix分支: $ svn co http://svn.seagullproject.org/svn/seagull/branches/0.6-bugfix 注意:目前最新的代码是在上面的0.6-BUGFIX分支 你可以选择在~/.subversion/config文件中设置: [miscellany] enable-auto-props = yes [auto-props] *.php = svn:eol-style=native *.html = svn:eol-style=native *.lang = svn:eol-style=native ... etc. 这样,整个代码库将使用统一的eol(译者注:eol为行结束符)(auto prop只会对新建文件起作用)。 用户与密码这里无需用户名与密码,在tortoise中这个栏位留空白. 版本分枝列表你可以在http://svn.seagullproject.org/svn/seagull/branches/上查看所有分支的列表 如何比较SVN库中的代码找出本地有修改的文件:$ svn status 如何发现远程svn库中有修改的文件:$ svn status -u 如何创建一个标签$ svn copy http://svn.seagullproject.org/svn/seagull/trunk http://svn.seagullproject.org/svn/seagull/branches/foo 如何导出一个版本$ svn export http://svn.seagullproject.org/svn/seagull/trunk 如何更新现在有的拷贝务必要进入安装Seagull所在的目录。如果你将Seagull checked out到/home/user/seagull,在运行update命令之前,请务必将目录切换到/home/user/seagull $ svn update 如何提交补丁浏览创建与SubmittingPatches部分 如何合并这个场景举例说明了如何将bugfix分枝代码整合到trunk中. 首先进入到trunk目录中 $ cd /var/www/html/seagull/trunk 首先,取得上次整合到trunk的版本号 $ svn log --stop-on-copy 比方说版本是1823 运行合并时使用 a –dry-run,如果你很肯定就不用了 $ svn --dry-run merge -r 1824:HEAD http://svn.seagullproject.org/svn/seagull/branches/0.4-bugfix 参数分别代表: svn -r[evision] [revision when branched]:[revision of 'merge from'] [url of 'merge from'] 在例子中省略了最后的参数,就是目标目录,也就是整合后文件的存放目录。这个被假定为”.”或当前目录. 如何转换一个存储库如果(新的svn库)是使用相同的服务器 $ svn switch http://svn.seagullproject.org/svn/newrepos /path/to/local/copy 如果你打算从不再运行服务器转换到新服务器 $ svn switch --relocate http://seagull.phpkitchen.com:8172/svn/seagull/trunk http://svn.seagullproject.org/svn/seagull/trunk /path/to/local/copy 如何导入一个存储库$ svnadmin create --fs-type fsfs /usr/local/svn/newrepos (从1.2版本开始,subversion默认创建的文件系统类型是'fsfs',你肯定很想用这种类型,因为BDB这种类型非常不稳定,尤其是BDB4.1) 然后设置相应的APACHE权限,并且: $ svn import mylocaldir http://svn.seagullproject.org/svn/newrepos/mylocaldir 如何导出一个存储库并加载到另一个文件系统中如果你误用了BDB这种类型,并且想用FSFS重建你的存储库。这是非常有用的。 转出已存在的存储库 $ svnadmin dump /usr/local/svn/oldrepos > myfile.dump 删除(并潜在地在备份)已存在的存储库 $ rm -rf /usr/local/svn/oldrepos 创建新的存储库 $ svnadmin create --fs-type fsfs /usr/local/svn/newrepos 加载导出文件 $svnadmin load /usr/local/svn/newrepos < myfile.dump 如何删除文件夹$ svn remove http://svn.seagullproject.org/svn/seagulll/branches/folder_to_delete 如何为第三方产商分支设置svn:externa建议在SVN库中在和trunk,分支,标签一样的层次上为第三方库创建他们自己的分支
svn propedit svn:externals .
export EDITOR=vim
pear http://sdn.seagullsystems.com/svn/customer/project/trunk/pear
如何设置svn属性为文件设置版本号 svn propset svn:keywords "Revision" file.php 如何将代码库中的文件变成可执行svn propset svn:executable ON etc/deploy_local.sh 如果修补一个已破坏的存储库$ svnadmin verify /usr/local/svn/seagull $ svnadmin recover /usr/local/svn/seagull $ chown -R nobody /usr/local/svn/seagull 备份$ /usr/local/src/subversion-1.1.4/tools/backup/hot-hackup.py /usr/local/svn/seagull /some/backup/dir Post-commit hooks, closing tickets你可在你提交的信息中传递参数,这些信息将被以这种形式搜索 command #1 command #1, #2 command #1 & #2 command #1 and #2 在一个信息中可以有多个命令。支持下列命令。每一个命令有多个写法,这样做主要是为了易于使用。
closes, closing, closed, fixes, fixing, fixed
The specified issue numbers are closed with the contents of this
commit message being added to it.
references, refs, addresses, re
The specified issue numbers are left in their current status, but
the contents of this commit message are added to their notes.
提交一个message可以做什么。下面是一个非常复杂的例子: Changed blah and foo to do this or that. Fixes #10 and #12, and refs #12. 这将关闭#10和#12,并添加记录到#12 删除.svn目录find . -name '.svn' -type d -exec rm -rf {} \;
列出所有代码贡献人及其所提交的补丁svn log -q | awk '/^r/ {print $3}' | sort | uniq -c SVN 程序
参考资料 |