Sunday, September 9, 2012

Common SVN Commands

Quick Sample: 

Checkout
Get the IP Address using ipconfig


Create a empty directory
Inside the directory, execute the checkout.

svn checkout http://192.168.30.131/repos/kernel/branches/SPI_Kernel .
Note the difference a "." makes.

The svn check out will ask for username and password.

This creates:
checkout with the latest revision.
...


Commit
svn commit -m "some comments"

Update
svn update

Add 
svn add "some file here..."


Saturday, September 8, 2012

Migrating SVN respository (Linux to Linux)

Below is the steps to migrate SVN repository:-
  • Start your terminal
  • $ svnadmin dump /path/to/your/repo > yourreporname.dump
  • $tar -zcf yourreponame.tgz yourreponame.dump 

    Tar command for compress:

    This steps is to transfer your dump file to your new machine. You will prompt to enter password for the new machine.
  • * For large dump file , you can compress it using tar before sending over thru network.
    Tar command for uncompress:
    tar -zxf yourreporname.tgz

    Tar command for uncompress:
    
    
    $ scp yourreponame.dump username@new.machine.ip:/path/to/your/new/repo 
  • 
    
  • Now your SVN dump file should be in new machine
  • Login to your new machine
  • cd /path/to/your/new/repo
  • svnadmin create reponame
  • svnadmin load reponame < yourreponame.dump
  • Done, you just just migrated your svn repository

 

Monday, August 13, 2012

SVN Server on Ubuntu 10.04 LTS with Web Access


SVN Server on Ubuntu 10.04 LTS with Web Access


To install SVN server, run this command at the command prompt:
sudo apt-get install subversion libapache2-svn apache2
Make the directory where you want to keep the svn repositories and edit the dav_svn.conf file:
sudo mkdir /svn
sudo nano /etc/apache2/mods-enabled/dav_svn.conf
Delete all the data and make it simple like this :-)
<Location /svn>
DAV svn
SVNParentPath /svn
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd
Require valid-user
</Location>
To create a svn user, gary , use the following command:
sudo htpasswd -cm /etc/apache2/dav_svn.passwd gary
We only need to use the -c option for the FIRST TIME, when you create a user, after that you will only use the -m option.
Move to the folder, where you want to keep your repositories and create your first repository:
cd /svn
sudo svnadmin create test_repo
Make sure you set the permissions of the /svn directory to apache with the following command:
sudo chown -R www-data:www-data /svn
Restart the apache2 service:
sudo /etc/init.d/apache2 restart
At this point, the SVN server is running.
In the browser, enter the localhost name or the IP Address to check if the respository is accessible.