subversion总结

时间:2024.2.15

学了subversion之后,我就把cvs忘得一干二净了,现在git越来越火了,在全面切换到git之前,特地总结一下subversion,以免以后又什么都不记得了。

创建仓库:

svnadmin create /path/to/repository

修改一下配置:

vi /path/to/repository/conf/svnserve.conf

如果不是开源项目的话可能需要配置禁止匿名访问:

[general]

anon-access = none

auth-access = write

password-db = passwd

设定用户密码:

vi /path/to/repository/conf/passwd

假设创建一个密码是123456的用户laowang

[users]

laowang = 123456

注意:这个密码只用于演示,它的强度无疑是很糟糕的。

此外,还可以设定基于路径的authz认证方式,读者请自己看配置文件,这里就不多说了。

subversion有很多运行方式,比如说搭配apache使用,不过它本身也可以单独作为服务存在:

svn -d -r /path/to/repository

在客户端可以使用svn import的方法来创建项目(也可以用svn mkdir的方式来创建项目,就不多说了):

mkdir -p /path/to/project/trunk

mkdir -p /path/to/project/branches

mkdir -p /path/to/project/tags

svn import /path/to/project svn://server/project

其中,trunk,branches,tags目录并不是必须的,但多数人习惯这样,所以最好不要标新立异。

接下来就可以checkout了:

svn co svn://server/project/trunk project

开发时常用的命令很简单,基本就是更新svn up,提交svn ci之类的。

在项目开发初期,可以仅仅使用trunk来管理代码,不过一旦项目发展起来,开发时就不应该直接操作trunk了,此时应该使用branches来管理代码,比如可以使用下面的命令建立一个名为1.x的branches:

svn copy svn://server/project/trunk svn://server/project/branches/1.x

开发工作都在branches中完成,一旦完成了编码,就可以把代码合并到trunk中去:

先要查查branches是什么时候创建的:

svn log --stop-on-copy svn://server/project/branches/1.x

假设查到的版本号是123, 然后进入到trunk工作拷贝中,执行:

svn merge -r 123:HEAD svn://server/project/branches/1.x

最后提交即可:

svn commit

这还不算完,此时应该在tags里发布这个新版本(比如说版本号是1.0):

svn copy svn://server/project/trunk svn://server/project/tags/1.0

为了记牢一点,再唠叨一下trunk,branches,tags的用途:

trunk:仅保存最新的稳定代码,代码的改变尽可能通过branches来merge,而不要手动commit代码。 branches:用来管理代码的日常开发,可以手动commit代码。

tags:仅保存各个版本的代码快照,比如类似版本:1.0,1.1,1.2等等。

不同人针对同样的文件提交修改的时候,subversion会尽可能的自动合并修改,不过有的时候无法还得手动来解决冲突,有以下几种方式:

1:放弃自己的修改,转而使用服务器端的代码版本:

svn revert file.php

svn update file.php

2:使用自己的代码版本覆盖服务端的修改:

cp file.php.mine file.php

svn resolved file.php

3:手动处理<<<<<<<和>>>>>>>标识出来的冲突代码:

svn resolved file.php

有一些文件和项目本身掺杂在一起,但不适合作为版本控制的保护对象,这时应该忽略它们,比如说Smarty的模板编译目录templates_c:

svn propedit svn:ignore /path/to/templates_c

使用subversion的自动属性功能可以节省很多精力,比如说想让不同系统的用户在得到php文件的时候使用适合自己的行结束符,可以这样:

vi ~/.subversion/config

[miscellany]

enable-auto-props = yes

[auto-props]

*.php = svn:eol-style=native

注意:如果你使用的是windows操作系统,配置文件config的路径是:%APPDATA%\Subversion\config

subversion有很多钩子脚本,可以方便维护工作,其路径位于:

cd /path/to/repository/hooks

里面有很多现成的模板,比如pre-commit,post-commit,我们可以用它来实现很多效果:

比如说我们想保证所有的svn ci操作都要编写适当的日志信息,可以这样:

cp pre-commit.tmpl pre-commit

这样就够了,钩子模板缺省的内容就实现了这个效果,具体的实现内容可以参考钩子本身代码。

post-commit文件也可以有很多用途,比如说我们可以利用它来自动更新线上代码,大概的代码如下:

/usr/bin/svn update /path/to/work/copy

最后说说svn+ssh的连接方式,本文的例子基本都是使用单纯的svn连接方式,不过svn+ssh可以使用系

统本身的账户作为验证方式,并且传输过程是加密的,所以更方便,更安全。

svnadmin create /path/to/repository

groupadd subversion

usermod -G subversion laowang

chgrp -R subversion /path/to/repository

chmod -R 770 /path/to/repository

进行了如上的准备工作后,就可以启动服务了:

svn -t -r /path/to/repository

然后在客户端设置配置文件:

vi ~/.subversion/config

[tunnels]

# ssh = $SVN_SSH ssh

缺省情况下,这里使用了一个名为SVN_SSH的环境变量,所以你需要设定一下它:

export SVN_SSH="/usr/bin/ssh [-p port ...]"

注意:如果是windows的花,可以使用putty中的plink,并在环境变量中设定SVN_SSH。

设定好了之后,就可以使用svn+ssh的方式了:

svn+ssh://server/path/to/repository/...

注意,使用svn+ssh连接的时候,后面是完整的物理路径,这和单纯使用svn连接时是不一样的。

好了,subversion常用的功能基本都介绍了一遍,时不时拿出来看两眼,应该就不会忘记了。


第二篇:SectionB 总结


SectionB 总结

这一部分是听力,我的薄弱点。所以做起来不太理想。以下是我看完答案后的感想。 首先,这三篇短文的问题选项都和短文有很大的关系,短文开头,中间,结尾。 第二,预览各题的选项,总是可以发现一些词,与推测出短文关于什么话题。例如

最后,我要做一下自我总结.我不知道我做的不好。上课时,学习时精神状态总不是很好,所以我要做一下自我调整。我现在明白学习对我的重要性,所以我要更加努力。

This part is listening, my weak spot.So it is not too ideal.The following is my feeling after watching the answer.

First of all, the problem of the three essay option and the essay has a lot to do, essay at the beginning, middle, end.

Second, preview option to each question, you can always find some words, and infer the passage about what topics.For example,

Finally, I'd like to summarize myself. I don't know what I do is not good.In class, learning mental state is not very good, always so I need to adjust myself.I now understand the importance of learning for me, so I need to work harder.

例题

改变新一代电子邮件的主要原因,是为了处理遗留下来的薄弱点。

The main cause for the change of new e-mail generation has to do with the left softkey.

我长期专注于听力和阅读,我需要将焦点转到完形填空上,因为这是我所有考试中最弱的一部分。 I have already focused on listening and reading for long and I need to prepare for the cloze, as this part is the weakest part of all my tests.

我的专长是口语,听力和阅读。

I specialize in speaking, listening and reading.

你能感受到他想与队友配合的愿望,而那曾是他的薄弱点。

You feel there is a real desire from him to play with the others, and that was perhaps his weak point before.

塔曼的海峡很明显是地壳的薄弱点,相当于布料上的小洞。

The strait at Taman is clearly a weak point in the crust, equivalent to the hole in the cloth.

第三, 我的听力不好;

Third, my listening is very poor.

听力是雅思考试中最难的一部分。

The Listening Test is the most difficult of the IELTS Sub tests.

北朝文学的研究,是古代文学研究中的薄弱点,其中原因很复杂。

Northern Dynasty literature has been least explored in ancient literary studies for a variety of complicated reasons.

所以,这是我的一部分。

So here's my portion.

可我相对还年轻,听力就不行了,看来这是家族的遗传。

But my level of hearing loss at a relatively young age suggests hearing problems run in my family.

我孩子也有听力问题,不过我们不知道这是永久的,还是暂时的。

Mine is hard of hearing we don't know if its permanent or temporary yet.

记住,这是我生命的一部分。

That was part of my life.

我明白了,这是游戏的一部分!

I SEE… It is a part of the game!

更多相关推荐:
Example Business Report英文公司报告范例

ExampleBusinessReportButlerGroupKeyFindingsTheeraoftheisolatedBusinessIntelligenceBItoolisdrawingtoacloseCertainlym...

Business Report

天津商务职业学院毕业设计商务报告BusinessReport专业班级学号姓名指导教师20xx年4月16日商务英语1001班级商务英语1001姓名联系电话BusinessReportAReportonTheImp...

Business Report

BusinessReport1ReportsFormatamemo式的报告p36写分bletter式的报告p37写分c在考试里常用的格式reportontitleintroductionfindingssumm...

business report 写作指导

商务英语报告则是以英语语言撰写的商务报告按种类划分常见的有事件调查报告InvestigativeReports意见调查报告SurveyReports周报告WeeklyReports月度报告MonthlyRepo...

Business report

20xx10学年第一学期商务英语读写译教案120xx10学年第一学期商务英语读写译教案Chapter8BusinessReportITheory1Theformatofbusinessreport1TitleP...

Business report

AreportoftraditionalbrochuremailoutsandemailstrategyAreportoftraditionalbrochuremailoutsandemailstrategyStuinfo16Ar...

Business report的introduction

ExecutivesummaryThefamousHUAWEIresignhappenedin20xxthisinternaldisputedrawmanypeoplesattentionCausedbythemisunderst...

英语商务信函写作模板1 Business Letter I

IntroductionBusinessletterismoreformalthanpersonalletteranditusuallyreferstorequestinginformationapplicat...

14 Business Proposal 商务建议书

BusinessProposal商务建议书建议书是指单位或个人对某项事业或工作有所研究和思考进而向有关领导政府企事业单位专业团体提出改进措施和建设性意见所形成的一种书面材料它也是英文商务写作常见的一种文体可以将...

Business_Proposal常用句型 及范文

TipsonWriting注意事项建议书要以事实为根据撰写提出的建议要具体操作性要强对采纳建议能带来的好处既要写的乐观也要防止吹嘘非自发性建议书中的项目投标书作为一种营运文件用于一项任务开发之前往往需要附有预算...

Business Economics 商业经济学essay范文

BusinessEconomics经济学的橘色目录介绍1供给和需求是如何影响汇率的外币吗2了解各种贸易壁垒制度的有效性这些实体实施制裁3积极影响增加经济效益的欧洲联盟结论书目介绍其中一个最重要的方面是国际贸易商...

外国教授建议的Business Plan Outline

BusinessPlanOutlineforTFSUTCCStudentsMayJune20xx50920xxCEOIExecutiveSummaryItwillbewrittenaftertheothersectionsofth...

business report(32篇)