zoukankan      html  css  js  c++  java
  • linux安装SVN

    需要把shop项目里的相关
    数据要检索到本地,使用checkout指令,以后就
    使用update来更新数据。

    使用yum安装svn

    [root@localhost ~]# yum -y install subversion
    [root@localhost ~]# svn help
    用法: svn <subcommand> [options] [args]
    Subversion 命令行客户端,版本 1.7.14。
    使用“svn help <subcommand>” 显示子命令的帮助信息。
    使用“svn --version”查看程序的版本号和版本库访问模块,或者
    使用“svn --version --quiet”只查看程序的版本号。
    
    大多数的子命令可接受文件或目录参数,对目录进行递归处理。
    如果没有指定参数,默认对当前目录(包含当前目录)递归处理。
    
    可用的子命令: 
       add
       blame (praise, annotate, ann)
       cat
       changelist (cl)
       checkout (co)
       cleanup
       commit (ci)
       copy (cp)
       delete (del, remove, rm)
       diff (di)
       export
       help (?, h)
       import
       info
       list (ls)
       lock
       log
       merge
       mergeinfo
       mkdir
       move (mv, rename, ren)
       patch
       propdel (pdel, pd)
       propedit (pedit, pe)
       propget (pget, pg)
       proplist (plist, pl)
       propset (pset, ps)
       relocate
       resolve
       resolved
       revert
       status (stat, st)
       switch (sw)
       unlock
       update (up)
       upgrade
    
    Subversion 是版本控制工具。
    欲取得详细资料,请参阅 http://subversion.apache.org/

    新建仓库目录

    [root@localhost ~]#  mkdir -p /svn/svndata/shop
    [root@localhost ~]# svnadmin create /svn/svndata/shop/
    进入仓库目录下,查看仓库的文件,命令:
    [root@localhost ~]# cd /svn/svndata/shop/
    [root@localhost shop]# ls
    conf  db  format  hooks  locks  README.txt
    hooks目录:放置hook脚步文件的目录
    locks目录:用来放置subversion的db锁文件和db_logs锁文件的目录,用来追踪存取文件库的客户端
    format目录:是一个文本文件,里边只放了一个整数,表示当前文件库配置的版本号
    conf目录:是这个仓库配置文件(仓库用户访问账户,权限)

    配置SVN服务的配置文件svnserver.conf

    [root@localhost shop]# cd conf/
    [root@localhost conf]# vi svnserve.conf
     19 anon-access = read
     20 auth-access = write
     27 password-db = passwd
    34 authz-db = authz
    39 realm = /svn/svndata/shop

    配置访问的用户及密码

    [root@localhost conf]# vi passwd 
    
    ### This file is an example password file for svnserve.
    ### Its format is similar to that of svnserve.conf. As shown in the
    ### example below it contains one section labelled [users].
    ### The name and password for each user follow, one account per line.
    
    [users]
    # harry = harryssecret
    # sally = sallyssecret
    user1=123456
    user2=123456

    配置新用户的授权访问的文件

    [root@localhost conf]# vi authz 
    [aliases]
    # joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average
    
    [groups]
    # harry_and_sally = harry,sally
    # harry_sally_and_joe = harry,sally,&joe
    
    # [/foo/bar]
    # harry = rw
    # &joe = r
    # * =
    
    # [repository:/baz/fuz]
    # @harry_and_sally = rw
    # * = r
    [/]
    user1=rw
    user2=r
    [root@localhost conf]# cat authz 
            [groups]
            group1 = liuxianan
            group2 = test1,test2
            [/]                #仓库下所有文件。
            @group1 = rw    #可读可写
            @group2 = r        #只读
            * =                #其他用户无任何权限。
            上面配置中创建了2个分组,分组1的用户可读可写,分组2的用户只读。

    启动svn服务

    [root@localhost conf]# svnserve -d -r /svn/svndata/shop/
    [root@localhost conf]# ps aux |grep svnserve
    root      17377  0.0  0.1 162200   656 ?        Ss   16:00   0:00 svnserve -d -r /svn/svndata/shop/
    root      17382  0.0  0.2 112676   984 pts/0    R+   16:00   0:00 grep --color=auto svnserve
    [root@localhost conf]# kill -9 17377
  • 相关阅读:
    git 删除已经提交的文件
    IDEA不显示service 服务窗口
    MySQL SQL语句查询结果 多列合并为1列
    Linux远程执行脚本
    mycat 连接命令
    win10 关闭被占用的端口
    ERROR 1045 (HY000): Access denied for user 'root', because password is error
    unblock with 'mysqladmin flush-hosts'
    neo4j数据库cypher查询
    基于websocket的网页实时消息推送与在线聊天(上篇)
  • 原文地址:https://www.cnblogs.com/liujunjun/p/12161967.html
Copyright © 2011-2022 走看看