Youry's Blog

Youry's Blog

SVN setup and SVN tricks

leave a comment »

Now I need to work with several partners and need to install a new repository into a Linux account.

very good paper how to work with versions: http://www.sepcot.com/blog/2007/04/SVN-Merge-Branch-Trunk

1. First of all I create a new repository it described below.

mkdir -p ~/Documents/REPOS
cd ~/Documents/REPOS/
ls
svnadmin create –fs-type=fsfs ./<repos>
ls -la test_repo/

2. to get access by other user you should read this paper http://kb.mediatemple.net/questions/776/HOWTO%3A+%28gs%29+SVN+multiple+users#gs

3. add new users to the owner user group:

Add existing user tony to ftp supplementary/secondary group with usermod command using -a option ~ i.e. add the user to the supplemental group(s). Use only with -G option :
# usermod -a -G ftp tony

see more here: http://www.cyberciti.biz/faq/howto-linux-add-user-to-group/

+++  Old one +++

I write nothing new in this post, simply a reminder for myself how to setup and work with svn on linux (fedora and mac hosts). I like version control for my source code and documents and already started to use this for my work documents (on my work’s servers) and on my the customer’s and home’s servers. I used this site as a guideline: http://tig.csail.mit.edu/twiki/bin/view/TIG/UsingSubversionAtCSAIL

Create the empty repository structure.
mkdir -p ~/Documents/REPOS
cd REPOS/
ls
svnadmin create —fs-type=fsfs ./test_repo
ls -la test_repo/

Import stuff into the repository:
cd ~/Documents
mkdir test_project
touch test_project/test_file.c
ls test_project/test_file.c
ln -s ./REPOS /REPOS
svn import ./test_project/ svn+ssh://macmini/REPOS/test_repo/ –message “initial import of test_project”

Make sure you can checkout a copy of the repository.
mkdir checkouts
cd checkouts
ls
svn checkout svn+ssh://macmini/REPOS/test_repo

change a working copy and update the repository
svn commit -m “your comments”

I have the latest version of files in my working copy
svn update

see more in SVN Book

Other issues:
correct any errors in place:
svnadmin recover

dump all svn actions to a log:
svnadmin dump > svn.dump

move existing repos out of the way:
mv papers papers.bdb

recreate repos; default type is FSFS:
svnadmin create papers

replay the log:
svnadmin load < svn.dump

group access setup: http://www.if-not-true-then-false.com/2010/svn-subversion-access-control-with-apache-and-mod-authz-svn/

+++ Some tricks, what I need in everyday life from  very good paper how to work with versions: http://www.sepcot.com/blog/2007/04/SVN-Merge-Branch-Trunk

1. Perform an SVN copy:

svn copy svn+ssh://server/path/to/trunk svn+ssh://server/path/to/branch/newBranch -m "Cut branch: newBranch"

2. Some useful commands:
  • conflict resolution: svn resolve –accept=working  workingFile  (for working file update)
    or =base Choose the file that was the BASE revision before you updated your working copy. That is, the file that you checked out before you made your latest edits.

    mine-full Resolve all conflicted files with copies of the files as they stood immediately before you ran svn update.
    theirs-full Resolve all conflicted files with copies of the files that were fetched from the server when you ran svn update.

    see more http://svnbook.red-bean.com/en/1.5/svn.ref.svn.c.resolve.html

3. very good site http://www.abbeyworkshop.com/howto/misc/svn01/

useful paper: http://designbygravity.wordpress.com/2009/10/19/what-mother-never-told-you-about-svn-branching-and-merging/
Advertisements

Written by youryblog

November 22, 2010 at 9:16 AM

Posted in IT, UNIX/Linux tricks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: