[[linux_wiki:svn]]

SVN

General Information

Subversion (svn) is a “free/open-source version control system”.

Checklist

  • Distro(s): Any
  • Package: svn installed

Create

Create a working directory space.


Checkout creates a local copy of the repo.

Checkout command

svn checkout URL

Shortcut

svn co URL

Modify

Make changes to a repo.


Update changes from the repo to your local copy.

svn update

Add a new file/directory to the repo. New file only gets pushed to the repo copy upon commit.

  1. Create a new file/directory locally
  2. Add the file with svn
    svn add mynewfile
  3. Commit the added file to the repo
    svn commit -m "Adding a new file to the project." mynewfile

Delete a file from the working copy. The file will be removed from the repo upon commit.

  1. Delete file via svn
    svn delete mynewfile
  2. Commit the deletion to remove from the repo
    svn commit -m "removing mynewfile." mynewfile

Move or rename a file. File is changed in the repo upon commit.

  1. Move/rename a file
    svn move oldfilename newfilename
  2. Commit move/rename
    svn commit -m "Renaming my file" newfilename

A commit saves changes to the repo.

Commit command

svn commit -m "my changes description"

Keep your working directory clean by listing and/or removing untracked files.

List untracked files

svn status --no-ignore | grep '^?' | awk '{print $2}' | xargs -I{} ls -l '{}'


WARNING: The following could remove work in progress!

Remove untracked files

svn status --no-ignore | grep '^?' | awk '{print $2}' | xargs -I{} rm -fv '{}'

Inspect

View status and logs.


Show the differences between your working copy and the repo copy.

svn diff myfilename

Show the status of the file(s) in the working copy.

svn status PATH

Show the character codes for various statuses

svn help status

View logged commits.

svn log PATH


View diff of a specific logged revision

svn log --revision r101 --diff

  • linux_wiki/svn.txt
  • Last modified: 2019/05/26 03:50
  • (external edit)