Skip to content

Instantly share code, notes, and snippets.

@adityaiitb
Created July 25, 2020 23:44
Show Gist options
  • Select an option

  • Save adityaiitb/8547453c281f69abd61a774bb9f30826 to your computer and use it in GitHub Desktop.

Select an option

Save adityaiitb/8547453c281f69abd61a774bb9f30826 to your computer and use it in GitHub Desktop.
SVN commands

How to create and launch a local svn repo

We should allow normal users (after authentication) on the host machine to use SVN. We should not give access to normal users to the SVN directory itself. Notes from here

In the following commands, # => as root, $ => as user.

Create a directory to hold the repository

# mkdir /var/svn

Create a repository

# cd /var/svn
# svnadmin create track

Create a trunk directory in the repo

# svn mkdir file:///var/svn/track/trunk -m "Making trunk"

Setup the server config and launch

Edit the repo configuration file

# vim track/conf/svnserve.conf

Add the following at the end of the general section

anon-access = none
auth-access = write
password-db = passwd
realm = Repo at EC2

Edit the password file for the repo

# vim track/conf/passwd

Add an entry for each user

ec2-user = aabbcc

Start the svnserver

# svnserve -d -r /var/svn/ --listen-host=localhost

To stop the server

# killall svnserve

Connect to the SVN server

$ svn co svn://localhost/track

To create a zipped SVN dump link

$ svnadmin dump /var/svn/track | gzip -9 > file.dump.gz

Ignore directory/files from svn (so that they don't show up as ? during svn status)

# svn propedit svn:ignore .

This will open an editor where you can type the name of files and directories you want to ignore in the current dir.

# svn propset svn:ignore <file/dir> .

Here, svn:ignore is the name of the property being set, <file/dir> is the value of the property and . is the directory on which the property is being set.

To check what properties are set

# svn proplist

To see the value of svn:ignore

# svn propget svn:ignore

To delete the properties previously set

# svn propdel svn:ignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment