SVN Starter

@SVN CENTRAL REPOSITORY

To Install SVN
#apt-get install subversion

To Create the SVN Repo
#svnadmin create sanoob.com

Under /sanoob.com/conf you will find repository configuration files, interesting for us at the moment are only passwd and svnserve.conf.

Edit the SVN Configuration File
#cd sanoob.com/
#vim conf/svnserve.conf

Edit also the svnserve.conf to have following contents:
[general]
anon-access = none
auth-access = write
password-db = passwd

Add the SVN User to the SVN
#vim conf/passwd

For testing edit the passwd file to have following contents
Entry: unni = 123unni

Notice that the password will be written in clear-text in this file, so for security reasons you might want NOT to use the same credentials as you use in your system as a login account (although if you make sure with chmod 600 passwd that only the user svnowner can access the file, the risk of someone being able to sneak a peak without administrative account or knowing the svnowner password is minimal).

Start SVN Server
#svnserve -d

[NOTE: SVN Port – 3690]

@DEV/LIVE INSTANCES

Make sure you have svn client tools installed on your computer. In command line issue:

If its for an already existing project say sanoob.com then to enable SVN for this Project,

Upload all the source code to the SVN Repo Initially

#svn import svn_monitored_dir svn://IPofSVN_CentralRepo:Location_of_SVN_repo@SVN_Svr
e.g:
#svn import public_html svn://24.24.24.24:/root/sanoob.com

AND, Bring down the first Check Out as Revision 1

#svn co svn://IPofSVN_Central_Repo:Location_of_SVN_Repo_ at_SVN_svr local_dir
e.g:
#svn co svn://24.24.24.24:/root/sanoob.com publicunni

ADD a New file and COMMIT IT
#cd [to the SVN Monitored Dir]
#echo “I am a Test” > test.txt
#svn add test.txt        [To add a bunch of files – #svn add *]
#svn ci -m “Commit test”

To get current SVN Revision Number
#svn info

To Update to Latest Changes
#svn up

To List the Modified Files
#svn status

Advertisements

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