A functional Subversion copy is a working copy that matches the repository's intended revision, has intact metadata in its .svn directory, and can run svn status and svn update without errors. You retrieve one in one of two ways: restore an existing checkout that's damaged or stale, or create a fresh checkout when the old one can't be repaired. The key condition is deciding which path you're on before you touch anything, because deleting a working copy that still holds uncommitted changes permanently loses them—SVN has no local undo once that metadata is gone.
This guide covers both paths in order, from the safest reversible checks to full re-checks, along with the failure modes that make a checkout "non-functional" in the first place.
First, diagnose what "not functional" actually means
Subversion failures look alike from the outside but have different fixes. Before running any repair, pin down the symptom, because the right next step depends on it.
A few common signatures and their likely causes:
svn: E155004: Working copy ... locked — a previous operation was interrupted. Usually fixable in place with svn cleanup. svn: E155037: Previous operation has not finished — same family as above; the work queue in .svn is stuck. svn: E155007: '...' is not a working copy — the .svn directory is missing, moved, or the path isn't what you think. Often a fresh checkout is the only fix. svn: E200033 or checksum/pristine errors — the pristine store (the compressed base copies of files) is corrupted. Sometimes repairable, sometimes not. svn: E170013 / E175002 connection errors — the working copy is fine; the server, URL, credentials, or network is the problem. Files present but svn status shows everything as unversioned or modified incorrectly — metadata and working files are out of sync.
The distinction that matters most: is the problem in the metadata (.svn) or in the connection to the server? Network and authentication errors don't require rebuilding anything. Metadata corruption does.
Before you repair: protect uncommitted work
This is the step people skip and regret. A working copy can contain local modifications, added files, and even a local history that exists nowhere else. Rebuilding destroys all of it, and SVN cannot recover it afterward.
Prerequisites: you need read access to the working copy directory. You do not need server access yet.
1: Open a terminal in the working copy root. 2: Run svn status. If it works at all, it lists modified (M), added (A), deleted (D), conflicted (C), and unversioned (?) items. 3: For every modified or added file you care about, copy it somewhere outside the working copy—a plain folder is fine. 4: If svn status itself fails, fall back to a filesystem copy: duplicate the entire directory tree to a safe location before any repair. 5: Note the current revision with svn info if it responds; otherwise read the Revision: line you remember or check the repo log later.
Success check: you have a copy of every file you'd be upset to lose, sitting outside any .svn-managed directory. Only then proceed.
If the working copy is clean (no local changes) and you've confirmed it with svn status, you can skip the manual backup—but confirming is mandatory, not optional.
Repair in place with svn cleanup
svn cleanup is the first real repair step and the least destructive. It removes stale locks, resumes interrupted operations, and clears the work queue. It's reversible in the sense that it doesn't alter your file contents or history.
1: From the working copy root, run svn cleanup. 2: If it reports success, run svn status again. 3: If status now works, run svn update to bring the copy to the intended revision.
Success check: svn status returns without error and svn update completes. If cleanup fails with a lock or work-queue error, try svn cleanup --remove-unversioned cautiously—but understand this only removes unversioned files, not the stuck state. For deeply broken work queues, a cleanup with a higher verbosity flag (svn cleanup -v) shows what it's doing and where it stalls.
If cleanup resolves the lock but svn update then fails with checksum or pristine errors, you've hit metadata corruption that cleanup can't repair. That's your signal to consider a rebuild rather than fighting it.
Recover the pristine store or relocate the checkout
Two mid-weight repairs sit between "cleanup" and "start over."
Relocating a moved checkout. If you moved or renamed the working copy's parent directory, or the repository URL changed (for example, a server migration from http:// to ), the metadata still points at the old location. Fix it with svn relocate NEW_URL, run from the working copy root. This rewrites the recorded URL without a full re-download. Success check: svn info shows the new URL, and svn update connects.
Repairing a damaged pristine store. The .svn/pristine area holds base copies used for diffs and reverts. If it's corrupted, svn status or svn diff may fail even though your working files look fine. Modern SVN clients can sometimes recover by running svn cleanup followed by svn update; if that fails, there's no reliable in-place rebuild of the pristine store. At that point a fresh checkout is the honest answer.
Do not manually edit or delete files inside .svn unless you fully understand SVN's internal format. Deleting .svn turns the directory into an unversioned folder—you lose the ability to commit, update, or diff, and you'll have to re-checkout and manually reconcile.
Retrieve a fresh functional copy by checking out
When repair fails or the copy is simply unrecoverable, a fresh checkout is the clean path. It produces a new working copy whose metadata is guaranteed consistent with the server at the chosen revision.
Prerequisites: the repository URL (from a teammate, svn info on a healthy copy, or your project docs), your credentials, and network access to the server.
1: Move the old, broken directory out of the way—rename it to project_broken rather than deleting it, so you can copy over uncommitted files afterward. 2: Choose where the new copy goes. 3: Run svn checkout URL [TARGET_DIR]. Optionally pin a revision with -r REV so you get exactly the state you expect rather than the latest. 4: Wait for the checkout to complete; it prints the checked-out revision. 5: Run svn status in the new copy—expect a clean result. 6: Run svn update once to confirm it talks to the server.
Success check: svn info shows the correct URL and a sensible revision, svn status is clean, and svn update reports "At revision N" with no errors. That's a functional copy.
If the repository is large, consider a shallow checkout with --depth immediates or --depth files to fetch only the top levels, then widen specific subdirectories with svn update --set-depth infinity path/to/subdir. This retrieves a functional copy faster when you don't need the whole tree.
If you only need a snapshot and won't commit, svn export URL gives you the files with no .svn metadata—lighter, but not a "functional working copy" in the sense of being able to commit back. Know which you need.
Reconcile your saved changes into the new copy
After a fresh checkout, your backed-up files from the safe location need to go back in.
1: Compare each saved file against its counterpart in the new checkout. 2: Copy your versions over the checked-out files. 3: Run svn status—they should now appear as modified (M). 4: Run svn diff to review exactly what changed against the repository. 5: Commit, or resolve conflicts if the repository advanced while you were away.
This is where a clean backup pays off. Without it, you're reconstructing changes from memory, which is error-prone and slow.
Common failure modes and their fixes
Locked working copy that cleanup won't clear. Sometimes a lock survives because the operation that created it was killed mid-write. A second svn cleanup from the exact root directory occasionally works; if not, and the lock file in .svn is clearly orphaned, a fresh checkout is safer than hand-editing internals. Symptoms of a truly orphaned lock usually come with other corruption.
"Not a working copy" after moving folders. Moving a subdirectory out of a checkout separates it from .svn, so it stops being versioned. Either move whole working copies, or re-add the files to a proper checkout.
Version mismatch between client and working copy. Upgrading your SVN client can change the working copy format; older clients then refuse to read it. Check svn --version and the working copy format with svn info. The fix is to use a compatible client version or perform a fresh checkout with the version you'll keep using.
Server or auth errors masquerading as corruption. E170013/E175002 and 401/403 responses mean the copy is fine but the connection or credentials aren't. Re-check the URL, svn auth cached credentials, and network reachability before rebuilding anything.
Interrupted checkout. A checkout killed halfway leaves an incomplete copy. svn cleanup then svn update usually completes it; if not, re-checkout into a fresh directory.
Deciding between repair and re-checkout
Use this rule of thumb: repair if the metadata is readable and the problem is locks or a moved URL; re-checkout if svn status can't run, the pristine store is corrupt, or cleanup repeatedly fails. Repair preserves history and avoids re-download; re-checkout guarantees a clean metadata state at the cost of bandwidth and a reconcile step. When in doubt, and your uncommitted work is safely backed up, a fresh checkout is the lower-risk choice—it produces a known-good copy and sidesteps internal corruption you can't see.
What a "functional" copy really guarantees
A functional working copy is not just files on disk. It guarantees three things: readable metadata so SVN commands work, a pristine store consistent with your files so diffs and reverts are accurate, and a recorded URL and revision so updates and commits target the right place. Verify all three—svn status runs clean, svn diff produces sane output, and svn info shows the correct URL and revision. If any of those fails, you don't yet have a functional copy, regardless of whether the files look right.
FAQ
Can I recover a working copy if I deleted the .svn folder?
No—the metadata is gone, so SVN no longer recognizes the directory as versioned. Your files remain, but you must checkout fresh and copy your files back in. That's why renaming a broken copy instead of deleting it preserves your options.
Does svn cleanup ever lose my changes?
It doesn't touch your working files or history; it clears locks and resumes queued operations. It can fail, but it shouldn't erase modifications. Even so, back up first if svn status still responds.
Why does svn update fail after a successful cleanup?
Often pristine-store corruption or a server-side issue, not a lock. Check whether the error is a checksum/pristine error (local corruption—consider re-checkout) versus a connection/auth error (network or credentials—fix those, don't rebuild).
Will a fresh checkout get me the exact revision I had?
Only if you specify it. svn checkout -r REV URL pins the revision; without -r, you get the latest. Use svn info on any healthy copy or the repository log to find the revision you want first.