Saturday, February 11, 2012

SVN and more on SVN

#which svn

If this returns a valid path as output, then it means that svn is installed on your linux box. If not, you need to install it. Installing subversion is very easy (for most distributions) and ample documentation is available on the web. You can start with http://subversion.apache.org/.

Four steps to complete svn repository creation on linux

1. log onto server as root
2. I prefer to have all svn repositories in one directory for better organization and easy maintenance. So next step for me would be to change to my svn directory.

cd /svnRepos

If you do not already have a directory for svn repositories, I would recommend creating one.

mkdir svnRepos

3. Create repository using following command

svnadmin create /path/to/repo/RepoName

where : RepoName is the name of repository to be created. As an example, I want to create a repository for my testproject. I would write

svnadmin create testproject

4. Change group ownership of repository for the intended group. In this case, consider I have a user group created as “all” and I want this group to have ownership to this repository.


chown -R :all /path/to/repo/RepoName
5. Grant Read/Write/Execute permissions to “all” on this repository

chmod -R 770 /path/to/repo/RepoName

6. Go to the /path/to/repo/RepoName/conf dir
and edit teh files. authz passwd svnserve.conf

authz
=====
[groups]
# harry_and_sally = harry,sally
admin = admin

# [/foo/bar]
# harry = rw
# * =
admin = rw


# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r
admin = rw
==============================
==============================
passwd
======
[users]
# harry = harryssecret
# sally = sallyssecret
admin = admin123
==============================
==============================
svnserve.conf
==========
[general]
anon-access = none [edit these 4 linies without giving any space]
auth-access = write
password-db = /svnrepo/repo/conf/passwd
realm = repo [repo is my repository name]

===========-------------==============


Kill the process.

[If old repo is thare - killall svnserve]
[ to remove all - rm -rf find .-type d - name svnrepo/]


start the server
==========
svnserve -d --listen-port 2122 -r /svnrepo/repo

svnserve -d --listen-host 172.2x.x.12 -r /svnrepo/repo

svn import /svnrepo/repo/main svn://172.2x.x.12/svnrepo/repo/ -m "Import"

svn checkout svn://172.2x.x.12/svnrepo/repo/

---------------===================----------------===========

try from windows it will work

===================================================

Add folder's in svn

Go to repo dir

mkdir project
svn add project
svn commit project


svn import DATA svn://172.2x.x.33/svnrepo/repo -F DATA/file1

svn import svn://172.2x.x.33/svnrepo/repo -F DATA/file1

====================================================

No comments:

Post a Comment