天天看点

linux搭建svn服务器记录下安装创建换成用户启动/停止检出更新提交忽略

安装

yum install subversion
           

创建

svnadmin create /data/svn
           

换成用户

vi /etc/passwd
//把/sbin/nothing改成/bin/base
//su - xxx 到用户再启动
           

启动/停止

svnserve -d -r /data/svn --listen-port xxxx
//停止
killall svnserve
           

如下错误:

svn: error while loading shared libraries: libaprutil-1.so.0: cannot open shared object file: No such file or directory

//查找
find / -name libaprutil-1.so.0
           

结果:

/www/wdlinux/httpd-2.2.22/lib/libaprutil-1.so.0

vi /etc/ld.so.conf
           

在结尾添加:

/www/wdlinux/httpd-2.2.22/lib/

更新下

ldconfig -v
           

检出

svn checkout --no-auth-cache svn://ip:port --username test1  --password 123456
           

更新

svn update --no-auth-cache --username test1  --password 123456
           

提交

svn commit -m "start" --no-auth-cache --username test1  --password 123456 
           

忽略

用文件忽略(记得提交下)

svn propset svn:global-ignores -F .svnignore .
//global-ignores是全局 
           

.svnignore文件内容:

.DS_Store
*.swp
Pods
.git
.git/*
.gitignore
README.en.md
README.md
runtime
*.log
.idea
*.gz
*.zip
*.rar
*.7z
*.tar
*.apk
*.exe
*.jar
*.temp

           

如有报错:

unpacking of archive failed on file /usr/bin/svn;5dcf9ee8: cpio: open

//目录里有个 i 权限

chattr -i /usr/bin
           

继续阅读