SVN Common Commands - CodeSwordsman

Subversion 1.14 essentials: checkout and update, add/delete/commit, logs and diffs, conflict resolution, revert and rollback, branches, tags and merges, plus svn cleanup and svnadmin backup and restore.

Subversion 1.14+Updated 2026-10-3036 commands

Checkout & Update

Check out trunk into a local directory; alias svn co

svn checkout https://svn.example.com/repo/trunk myproj

Update the working copy to the latest revision; alias svn up

svn update

Update to a specific revision to reproduce an old issue

svn update -r 1234

Show local changes; -u also reports incoming updates

svn status
svn status -u

Show the working copy URL and revision to confirm the branch

svn info
svn info --show-item revision

List repository contents without checking out; alias svn ls

svn list https://svn.example.com/repo/trunk

Changes & Commit

Put a new file under version control; use --force for whole trees

svn add src/new-file.ts

Schedule a tracked file for deletion; plain rm will not reach the repo

svn delete src/old-file.ts

Commit local changes with a clear message; alias svn ci

svn commit -m "feat: add export api"

Commit only the given path to avoid unrelated changes

svn commit -m "fix: typo" src/app.ts

Show uncommitted changes or the diff between two revisions

svn diff
svn diff -r 100:110

Discard uncommitted changes in one file

svn revert src/app.ts

History & Blame

Show the latest 10 commit messages

svn log -l 10

Show commits in a revision range with changed paths

svn log -v -r 100:120

Show the last revision and author of each line

svn blame src/app.ts

Print a file at a given revision without touching the working copy

svn cat -r 120 src/app.ts

Show the change introduced by a single commit

svn diff -c 120

Conflicts

A C status on update means a conflict; the file gets conflict markers

svn update

List every conflicted path so none are missed

svn status | grep "^C"

Mark resolved after merging manually and removing conflict markers

svn resolved src/app.ts
Risky

Accept the repository side during merge; other values include mine-full and postpone

svn merge --accept theirs-full ^/trunk

Revert & Rollback

Risky

Recursively discard all uncommitted changes with no undo

svn revert -R .
Risky

Back out a commit by reverse merging, then commit the result

svn merge -c -120 .

Roll the working copy back for verification and return with svn update

svn update -r 119

Export a revision to a clean directory without .svn metadata

svn export -r 119 https://svn.example.com/repo/trunk ./release-119

Branches & Tags

Branches are server-side copies; prefer ^/trunk and ^/branches/feat-export

svn copy https://svn.example.com/repo/trunk https://svn.example.com/repo/branches/feat-export -m "branch: export"

Switch the working copy to another branch without re-checkout

svn switch ^/branches/feat-export

Merge trunk changes into the current branch, then commit after resolving

svn merge ^/trunk

Legacy reintegrate for feature branches; 1.8+ uses plain svn merge on an up-to-date copy

svn merge --reintegrate ^/branches/feat-export

Tags are copies too; treat them as immutable by convention

svn copy ^/trunk ^/tags/v1.2.0 -m "release: v1.2.0"

Cleanup & Repository Ops

Clear locks left by interrupted operations

svn cleanup

Upgrade working copies created by clients older than 1.7

svn upgrade

Set ignore patterns for the current directory and commit the property change

svn propset svn:ignore "node_modules
dist" .

Create a repository on the server, exposed via svnserve or Apache

svnadmin create /data/svn/repo

Full repository backup and restore, the safest way to migrate servers

svnadmin dump /data/svn/repo > repo.dump
svnadmin load /data/svn/repo-new < repo.dump

Export a compact history as XML for scripting

svn log -q --xml > history.xml

This website uses cookies to ensure you get the best experience on our website. Privacy Policy.