SVN Application

一、SVN客户端:TortoiseSvn

下载地址: http://tortoisesvn.net/downloads.html

安装完后重启, 右击就可以使用SVN命令

首先, 从服务器版本库那边 svn Checkout....代码, 放到本地

在checkout目录下(带有.svn文件夹), 主要有以下命令:

常用的 SVN Add...  Delete...  Rename...  Update to revision.... Revert  Get lock/Releae lock...

本地Update 出服务器上最新代码

add/delete/edit/rename file 都只是在本地做修改,  要执行 commit 操作才能提交到服务器上。

二、SVN服务器:Subversion

1、安装

下载地址:http://www.visualsvn.com/

个人认为最好用VisualSVN server服务端和TortoiseSVN客户端搭配使用

安装完成后, 点击Window->VisualSVN->VisualSVN Server Manager, 就可以直接使用应用管理器来操作SVN 库

2、SVN 仓库

在Repositories可以CreateNewRepository,新建新的库, 选择库的结构如下:

1)、三个子目录的区别:

tag,一般情况下, 是用来做一个milestone的,不管是不是release,都是一个可用的版本。这里,应该是只读的。更多的是一个显示用的,给人一个可读(readable)的标记。

branch,是用来做并行开发的

trunk, 是主线

2)、仓库转移

(eg: move RepA to RepB)

•Copy RepA Repositories forder to  RepB

•Open RepB VisualSVN Server Manager

•Right click Repositories->All Tasks->import existing repository

•Copy the file ‘groups.conf’  ‘htpasswd’ ‘authz’ from RepA to RepB again to keep the permission set.

3、权限控制

Create User

Create Groups and add users

Then you can add access permissions in any directory levels or specific file.

4、svn hook

建完仓库后, 每个仓库下, 都有一个D:\SVNrepository\myRepositoryt\hooks 文件夹, 放SVN钩子程序, 用来提供的第三方增加自定义事物处理, 比如:

•start commit: excute when you click ’ok’,eg: judge if user has right to commit.

•pre commit: excute before the change is saved to Rep,eg: check whether the log as expected.

•post commit: excute after commit transtion end,eg:you can redeploy environment automatically by add some batch commands.

特定hook类型里面有特定提供的参数,如

REPOS 路径, TXN 事物,USER 用户…

Test.py %REPOS% %TXN% call python/perl..script to achieve more functional control.

示例:

window下, 建pre-commit.bat文件, 放在hooks下, 则该仓库下执行commit时, 必须输入10个字符。 默认安装下,svn可以无comment提交

@echo off
setlocal
set SVN_BINDIR="D:\Program Files\VisualSVN Server\bin"
set REPOS=%1
set TXN=%2
rem check that logmessage contains at least 10 characters
%SVN_BINDIR%\svnlook log "%REPOS%" -t "%TXN%" | findstr ".........." > nul
if %errorlevel% gtr 0 goto err
exit 0
:err
echo Empty log messge not allowed.Please log at least 10 characters! 1>&2
exit 1

SVN_BINDIR是svnserver安装路径下的bin文件夹

三、版本控制过程

1、Create a repository

1)Right click in Repositories and create New Repository…

2)Select the second Radio to create a Repository with trunk/baches/tags

3)You can also set access permissions  here.

2、Import project to ${repName}/trunk

Go to the project Directory, click svn->import, input the trunk path (get path:copy the trunk URL by right click at trunk folder and click ’copy URL to clipboard’)

3、Check out trunk code to local

New a directory ’svnTrunk’  to store trunk code, then you can excute new Branch/tag, merge etc.

4、New branches Right click in ‘svnTrunk’ and right click->svn->Branch/tag…

note:不要在branches上先建branch_1文件夹再以此为目录地址来copy,这样会提示Path ‘branches/branch_1‘ already exists,认为branch_1就是已经建好分支, 不能再建),同样方式, 可以创建很多个分支, 并行开发

After  new branch in Repository

We can check out the branch code to working copy

Develop………….

Commit code to branch

5. Merge trunk to branch

Note:to avoid a world of difference between branch and trunk, we’d better make branch keep pace with trunk by merge trunk to branch.

Also, we’d better merge trunk to branch before doing merge to trunk

1)Select ‘Merge a range of revision’

2)Input trunk path, Revision range to merge

note: How to decide the merge Revisions:

Click show log to sure what the versions to merge.

3)Resolve the confict, and compile/test_compile the project

4)Commit to RepositoryT1/branches/branch_2 after step5.3 build success.

Continue to develop in branch_2

Commit chages in branch_2 to branch_2 Repository …

Repeat step5 to keep branch sync with trunk when necessary.

Merge branch_2 to trunk as step6

Merge trunk to branch  again to Mark the newest version(RecordOnly)

6.Merge branch to trunk

1)Select ‘Reintegrate a branch’

2)Input the branch_1 path to ‘From URL’

3)Click ‘Test merge’ Button to test if it has many conflicts.

4) Resolve the confict, and compile/test_compile the project

5) Commit to RepositoryT1/trunk after step6.4 build success.

7.Copy trunk to tag

Copy trunk to tag when we released a stable version.

8.Merge summary

1)Remember to update to newest version in working copy before merge

2)Step 1-2 Corresponds to ‘version-control step6’

3)Step 3-4 Conrreponds to ‘version-control step5’

4)Do step1-2 frequently to keep branch sync with trunk.

trunk log:

在Log Messages窗口的左下角勾选了"Include merged revisions"你还能看到额外的Merge information:

其中灰色的log, 是branch里自己变化的log , 包括了版本信息。

SVN Application,布布扣,bubuko.com

时间: 2024-10-21 00:40:36

SVN Application的相关文章

svn学习之二(svn+httpd 部署脚本)

#!/bin/shsoft_path=/soft/tooltar_path=/usr/local/srcapr_dir=/usr/local/src/apr-1.5.2 apr_util_dir=$tar_path/apr-util-1.5.4 httpd_dir=$tar_path/httpd-2.4.16svn_dir=$tar_path/subversion-1.9.1pcre_dir=$tar_path/pcre-8.36sqlite_dir=$tar_path/sqlite-autoc

CentOS6.8 搭建SVN(版本控制系统)及SVN的使用

CentOS搭建SVN 查看系统环境 (1)查看系统版本 [[email protected] ~]# cat /etc/redhat-release CentOS release 6.8 (Final) (2)查看系统全部信息 [[email protected] ~]# uname -a Linux node-005 2.6.32-642.15.1.el6.x86_64 #1 SMP Fri Feb 24 14:31:22 UTC 2017 x86_64 x86_64 x86_64 GNU/

CentOS6.8下搭建SVN及使用

查看系统环境 (1)查看系统版本 [root@node-005 ~]# cat /etc/redhat-releaseCentOS release 6.8 (Final) (2)查看系统全部信息 [root@node-005 ~]# uname -aLinux node-005 2.6.32-642.15.1.el6.x86_64 #1 SMP Fri Feb 24 14:31:22 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux (3)查看系统内核 [root@

安装配置csvn

1 安装环境准备 1.1 下载JDK解压 在安装CSVN之前必须先安装JDK 将下载好的jdk-8u144-linux-x64.tar.gz解压并拷贝到/usr/local目录下 cp -r jdk1.8.0_144/ /usr/local/ 1.2 配置环境变量 添加环境变量 cat >>/etc/profile << EOF export JAVA_HOME=/usr/local/jdk1.8.0_91 export PATH=$JAVA_HOME/bin:$PATH expo

CSVN安装配置

一.安装环境准备1.下载JDK解压 将下载好的tar -zxvf jdk-8u211-linux-x64.tar.gz解压并拷贝到/usr/local目录下 # tar -zxvf jdk-8u211-linux-x64.tar.gz -C /usr/local/ cd /usr/local mkdir /usr/local/java cd jdk1.8.0_211/ 2.配置环境变量 添加环境变量 echo /usr/local/java/jdk1.8.0_211 >> /etc/profi

Solaris 10配置VNCServer 的具体配置方法

1.查看软件 # pkginfo -i SUNWxvnc system      SUNWxvnc X11/VNC server 2.配置GDM # vi /etc/X11/gdm/gdm.conf 在文件最后加上以下内容: [xdmcp]Enable=true[security]DisallowTCP=falseAllowRoot=trueAllowRemoteRoot=true 3.开启cde-login或gdm2-login # svcadm enable svn:/application

解决eclipse中svn插件总是提示输入密码的问题

一.背景 最近在eclipse中使用svn插件进行远程仓库代码管理时,老是出现提示让输入密码,特别烦人,经过努力,终于解决该问题,拿来和大家分享~ 二.svn插件密码机制以及出现问题的原因分析 当我们第一次使用svn插件并输入密码时,会生成一个保存密码的文件,然后每次svn插件默认去读取用户名和密码信息.启动eclipse时,会自动将配置信息读取到程序缓存中. svn的密码修改以后,无法再次登录,也没有提示重新输入密码.这时,我们可以通过删除相关配置文件的方式让svn插件提示我们重新输入密码.但

MyEclipse中SVN用户名密码的切换

WindowsXP: 将C:\Documents and Settings\Administrator\Application Data\Subversion\auth\svn.simple文件夹下的所有文件删除就行了 Application Data是隐藏文件 要先显示隐藏文件 Windows7: 将C:\Users\admin\AppData\Roaming\Subversion\auth\svn.simple文件夹下的所有文件删除就行了 其中AppData是隐藏的文件夹,也是要先显示出来才

清除Eclipse中SVN用户的方法

1)查看你的Eclipse中使用的是什么SVN Interface(中文:svn接口)windows > preference > Team > SVN 在右边的设置面板中可以看到SVN Interface或中文的svn接口一栏,Client的选项框中显示的就是你当前用的svn接口 2)如果是用的JavaHL, 找到以下目录 C:\Documents and Settings\用户名\Application Data\Subversion\应看到有一个auth目录,删除auth目录中的相