注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

Computer Science

I Pressed My Words Here. Will You Read ?

 
 
 

日志

 
 

SVN  

2012-05-11 14:07:32|  分类: 读书笔记 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
书名:Version Control with Subversion
豆瓣评分:分(9人评价)
博主评价:
未评价很差较差还行推荐力荐
来自豆瓣读书资源

安装svn:
computerscience@blog.163.com$ sudo apt-get install subversion

开始使用SVN
参考:SVN Tutorial fo Unix http://maverick.inria.fr/~Xavier.Decoret/resources/svn/index.html
http://svnbook.red-bean.com/
http://www.linuxidc.com/Linux/2007-06/4673p2.htm
http://os.51cto.com/art/200908/143157.htm
http://blog.lamb-mei.com/2011/01/linux-svn.html
svn在linux下的使用(svn命令)http://www.itlearner.com/article/4450
how-to-change-subversion-working-copy-uuid http://superuser.com/questions/229983/how-to-change-subversion-working-copy-uuid

创建SVN项目目录:
computerscience@blog.163.com:~/Downloads/svn$ svnadmin create --fs-type fsfs ~/Downloads/svn
computerscience@blog.163.com:~/Downloads/svn$ ls
conf  db  format  hooks  locks  README.txt
computerscience@blog.163.com:~/Downloads/svn$ svn ls file:///home/computerscience/Downloads/svn
computerscience@blog.163.com:~/Downloads/svn$

checkout 远程文件内容:
computerscience@blog.163.com:~/Downloads/svn$ svn checkout http://red5.googlecode.com/svn/java/example/trunk/ red5-example-readonly
 
查看日志:
computerscience@blog.163.com:~/Downloads/svn$ svn log red5-example-readonly/

更多的参考上方参考内容吧。

-----------------------------------------------------------------------
接下来Google&Studying 不由自主的变成读书笔记了……
-----------------------------------------------------------------------

查看和服务器上不一致的文件列表:
svn status -u
更新:
svn update
增加文件
svn add [filePath]  然后执行svn status看看变化,再通过svn commit提交新增。
创建 变更列表(changelist):
svn changelist [changeListName] [filePath]
当我们在一个项目中有多处修改存在,而不希望同时提交这些修改时,我们可以使用changelist来将各个不同关系的文件进行分类。
在提交更改时,我们可以使用命令:
svn commit --changelist [changeListName] 来提交该changelist中包含的有更改的文件。而,没有在这个changelist列表中的文件,无论是什么状态,都不会在此次提交中被提交。(这功能真实用,我遍历文档许久才发现,瞧见恨晚啊~)
重命名changelist:
svn changelist [newChangeListName] --changelist [changeListName] --depth infinity  .   (svn 1.6下无法正常执行)
--depth empty
Include only the immediate target of the operation, not any of its file or directory children.
--depth files
Include the immediate target of the operation and any of its immediate file children.
--depth immediates
Include the immediate target of the operation and any of its immediate file or directory children. The directory children will
themselves be empty.
--depth infinity
Include the immediate target, its file and directory children, its children's children, and so on to full recursio

删除changelist:
svn changelist --remove --changelist [changeListName] --depth infinity  .
提交所有变更:
svn ci
提交制定路径变更:
svn ci [path]
提交时带上描述:
svn ci -m [Description]
svn ci -F [Description File Address]
或者svn会在编辑器中让你确认提交时要附带的描述内容。
(如果不保存就退出编辑器,此次提交将不会执行。如果,修改了并保存了,但是尚未退出,只需将编辑器中内容清空并保存退出,此次提交也不会执行。)

查看文件冲突:
检查文件的本地变更(即未提交的变更):
        svn diff [filePath]
比较本地文件和SVN服务器上文件差异:
        svn diff --reversion [fileReversion] [filePath]
比较服务器上两个版本间差异:
        svn diff --reversion [fileReversionA]:[fileReversionB] [filePath]
比较服务器上某版本和前一版本间差异:
        svn diff --change [fileReversion] [filePath]
修改完冲突后,标记为冲突已解决:
        svn resolve --accept working [filePath]


If you want to see what changed in that revision,
try pointing svn log directly at the topmost URL of your repository, as in svn log -r 2 ^/


查看文件在当前版本中每一行,分别由谁最后修改:
        svn annotate [filePath]
        并且带上修改事件:
        svn annotate -v [filePath]
        再结合 | grep [userName]我就喜欢了。annotate和blame及prasie通效。


SVN PATCH
svn diff [filePath] > [patchFile]可以将diff的结果存入到一个文件中,而这个文件就是patch文件(类似于补丁文件,内容用于记录svn管理的文件发生了什么变化。)
svn patch [patchFile] 可以将记录变化的内容导入到svn中。即,本地文件即便没有这样的更改,svn也会根据导入的patchFile中描述的更改,对本地文件做相应的更改操作。详见SVN page 46/pdf page 68

SVN LOCK
svn lock [filePath] 用于锁定当前文件的修改权限,避免因和他人同时修改,造成冲突。
在svn status 结果中,锁定状态下(LocKed)的文件前面会有一个标识字母 K。而其他人的结果中会是标识字母O (Other)

SVN UNLOCK
svn unlock 用于将之前lock的文件解锁。lock的非所有者,可以在svn unlock后添加--force参数用于强制解锁。之后,svn status结果中可能有标识B(Broken)或T(sTolen)。

SVN INFO
svn info [filePath] 通常从本地缓存中读取相关信息。


SVN SWITCH
        svn switch [RootPath] 用于当服务器地址发生改变后,更新服务器地址,即项目文件存放的远端地址。

-------------------------------------------------------------------------------
SVN 中用于统计查看目录下某人最后修改过哪些文件的命令:
will@will-Lenovo-V480s:/data/workspace/****/trunk/src/main/webapps/****$ svn list -v webapp/page/ --depth infinity |grep will
    920 will                 Nov 26 17:48 ./
    920 will                 Nov 26 17:48 call/
     18 will            2035 Sep 09 09:35 call/callManager.html
    456 will             417 Oct 28 16:25 call/contactCustomer.htm
    887 will                 Nov 25 10:52 call/css/
    887 will            1625 Nov 25 10:52 call/css/contents.css
    103 will             332 Oct 08 18:23 call/customerDataAssignment.htm
    385 will             379 Oct 25 09:36 call/desktop.htm
    757 will             360 Nov 11 11:13 call/guaranteeSlipInfo.html
    920 will                 Nov 26 17:48 call/js/
     17 will          106469 Sep 09 09:31 call/js/callManager.js
    915 will           13234 Nov 26 17:16 call/js/contactCustomer.js
    284 will            2037 Oct 18 12:02 call/js/convert_object_2_string.js
    886 will           16058 Nov 25 10:13 call/js/customerDataAssignment.js
    916 will            9321 Nov 26 17:20 call/js/desktop.js
    915 will           13566 Nov 26 17:16 call/js/insurancePolicyManagement.js
    913 will           67962 Nov 26 16:37 call/js/notification.js
    908 will           16694 Nov 26 14:26 call/js/salesPersonnelPerformanceDeductionPreCalculation.js
    886 will           10482 Nov 25 10:13 call/js/sellingDailyAgentReport.js
    886 will           10983 Nov 25 10:13 call/js/sellingDailyOrganizationProfitReport.js
    886 will           10801 Nov 25 10:13 call/js/sellingDailyOrganizationReport.js
    920 will           12603 Nov 26 17:48 call/js/sellingDetailsReport.js
    399 will             518 Oct 25 13:47 call/notification.htm
    316 will             399 Oct 21 15:20 call/salesPersonnelPerformanceDeductionPreCalculation.htm
    292 will             347 Oct 18 15:58 call/sellingDailyAgentReport.htm
    308 will             374 Oct 21 11:14 call/sellingDailyOrganizationProfitReport.htm
    308 will             361 Oct 21 11:14 call/sellingDailyOrganizationReport.htm
    292 will             340 Oct 18 15:58 call/sellingDetailsReport.htm
    105 will                 Oct 08 18:42 data/
    104 will             640 Oct 08 18:41 data/dataSetManagement.htm
    105 will                 Oct 08 18:42 data/js/
     85 will           51700 Sep 30 11:57 data/js/dataSetManagement.js
     88 will            2534 Sep 30 16:34 data/js/tranlationManagement.js
    105 will            2383 Oct 08 18:42 data/js/translationManagement.js
    104 will            6872 Oct 08 18:41 data/tranlationManagement.htm
    105 will            6641 Oct 08 18:42 data/translationManagement.htm
    777 will             281 Nov 12 09:37 frame/sysInfo.htm
     88 will                 Sep 30 16:34 organization/
     88 will                 Sep 30 16:34 organization/js/
     88 will            9744 Sep 30 16:34 organization/js/organizationManagement.js
     88 will            5419 Sep 30 16:34 organization/js/principalManagement.js
     88 will            9087 Sep 30 16:34 organization/js/roleAssignment.js
     88 will            7405 Sep 30 16:34 organization/js/userAssignment.js
     88 will             343 Sep 30 16:34 organization/organizationManagement.htm
     88 will             273 Sep 30 16:34 organization/principalManagement.htm
     88 will             327 Sep 30 16:34 organization/roleAssignment.htm
     81 will             280 Sep 30 09:53 organization/userAssignment.htm
    481 will                 Oct 29 17:48 poi/
    423 will                 Oct 26 16:51 poi/js/
    423 will            3197 Oct 26 16:51 poi/js/import.js
    481 will            7684 Oct 29 17:48 poi/review.jsp
    775 will             227 Nov 11 17:12 recycle/recycle.html
     88 will                 Sep 30 16:34 role/
      9 will            6266 Sep 05 11:55 role/dataAuthoritySetting.htm
     88 will                 Sep 30 16:34 role/js/
     88 will           15398 Sep 30 16:34 role/js/roleManagement.js
      9 will            2884 Sep 05 11:55 role/roleAuthorityDuplication.htm
     88 will             267 Sep 30 16:34 role/roleManagement.htm
      9 will            6740 Sep 05 11:55 role/roleMutexGroupManagement.htm
      9 will           11399 Sep 05 11:55 role/roleMutexGroupRoleAssignment.htm
    772 will             232 Nov 11 16:12 secondary_Allocation/secondary_Allocation.html
    104 will                 Oct 08 18:41 system/
     10 will             263 Sep 05 11:56 system/commandLog.html
    104 will            7395 Oct 08 18:41 system/dictionaryManagement.htm
     10 will             272 Sep 05 11:56 system/dictionaryManagement.html
     85 will                 Sep 30 11:57 system/js/
     10 will            3819 Sep 05 11:56 system/js/commandLog.js
     85 will           26312 Sep 30 11:57 system/js/dictionaryManagement.js
     10 will           20738 Sep 05 11:56 system/js/menuManagement.js
     10 will            6322 Sep 05 11:56 system/js/objectRuleManagement.js
     10 will            8728 Sep 05 11:56 system/js/systemParamManagement.js
     10 will             327 Sep 05 11:56 system/menuManagement.html
     10 will             273 Sep 05 11:56 system/objectRuleManagement.html
     10 will             275 Sep 05 11:56 system/systemParamManagement.html
    499 will            3079 Oct 30 15:06 test/table_dynamic.htm
     88 will                 Sep 30 16:34 user/
     88 will             329 Sep 30 16:34 user/authorityAgency.htm
     88 will                 Sep 30 16:34 user/js/
     88 will            9887 Sep 30 16:34 user/js/authorityAgency.js
     88 will           14799 Sep 30 16:34 user/js/userManagement.js
      9 will            8020 Sep 05 11:55 user/userGroupManagement.htm
      9 will            8873 Sep 05 11:55 user/userGroupUserAssignment.htm
     81 will             267 Sep 30 09:53 user/userManagement.htm
      9 will            6739 Sep 05 11:55 user/userRoleCheck.htm
will@will-Lenovo-V480s:/data/workspace/****/trunk/src/main/webapps/****
ref:svn如何查看修改的文件记录? http://www.chinabin.cn/webserver/1168.html
END.
svn-book-For Subversion 1.7-r4421.pdf(1.94M)   
下载HTML方式查看
computerScience推荐阅读:
  评论这张
 
阅读(1292)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017