{"id":290,"date":"2026-10-13T09:21:06","date_gmt":"2026-10-13T09:21:06","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/2010\/11\/26\/examining-history-in-subversion\/"},"modified":"2026-10-13T09:21:06","modified_gmt":"2026-10-13T09:21:06","slug":"examining-history-in-subversion","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/examining-history-in-subversion\/","title":{"rendered":"How to Examine History in Subversion (SVN) with log, diff, cat, and list"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><em>Originally published on 2010-11-26; fully revised and updated.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you work with Subversion, history inspection is how you answer core operational questions quickly: <strong>what changed, who changed it, and when it changed<\/strong>. This article helps developers, release engineers, and support teams use SVN history commands effectively, with a practical workflow and reusable command examples.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What each SVN history command is best at<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Subversion provides multiple history commands, each optimized for a different level of detail. In practice, you will often use them together.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Command<\/th><th>Best for<\/th><th>Level of detail<\/th><th>Typical output<\/th><\/tr><\/thead><tbody><tr><td><code>svn log<\/code><\/td><td>Finding relevant revisions, author, date, and commit messages<\/td><td>High-level revision metadata<\/td><td>Revision entries and changed paths (with verbose mode)<\/td><\/tr><tr><td><code>svn diff<\/code><\/td><td>Inspecting exact line-by-line code changes<\/td><td>Line-level patch detail<\/td><td>Added\/removed\/modified lines between revisions<\/td><\/tr><tr><td><code>svn cat<\/code><\/td><td>Viewing file contents exactly as they were in a past revision<\/td><td>Full file content snapshot<\/td><td>File text printed to standard output<\/td><\/tr><tr><td><code>svn list<\/code><\/td><td>Checking directory contents at a specific revision<\/td><td>Directory-level view<\/td><td>Names of files and subdirectories for that revision<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Workflow: trace a problem back to a specific revision<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A reliable way to investigate historical changes is to start broad with logs, then drill down with diffs and content retrieval.<\/p>\n\n\n\n<pre class=\"mermaid\">\nflowchart TD\n    A[Start with a file or directory] --> B[Run svn log]\n    B --> C{Need line level details}\n    C -- yes --> D[Run svn diff on candidate revision]\n    C -- no --> E{Need exact old file content}\n    D --> E\n    E -- yes --> F[Run svn cat at that revision]\n    E -- no --> G{Need directory view at revision}\n    F --> G\n    G -- yes --> H[Run svn list at that revision]\n    G -- no --> I[Record revision and findings]\n    H --> I\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Command examples you can reuse<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Use these examples as templates and replace paths, revision numbers, and URLs with values from your repository.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1) View commit history with svn log<\/h3>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs language-bash\">svn log -l 10\nsvn log path\/to\/file.txt\nsvn log -r 120 path\/to\/file.txt\nsvn log --verbose -r 120 path\/to\/project<\/code><\/span><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Use <code>svn log<\/code> first to identify candidate revisions before deeper inspection.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2) Inspect line changes with svn diff<\/h3>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs language-bash\">svn diff -c 120 path\/to\/file.txt\nsvn diff -r 119:120 path\/to\/file.txt<\/code><\/span><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Use <code>svn diff<\/code> when you need the precise code-level change, not just commit metadata.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3) Retrieve historical file content with svn cat<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript language-bash\">svn cat -r <span class=\"hljs-number\">120<\/span> path\/to\/file.txt\nsvn cat -r <span class=\"hljs-number\">120<\/span> https:<span class=\"hljs-comment\">\/\/svn.example.com\/repo\/trunk\/path\/to\/file.txt<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\"><code>svn cat<\/code> is useful when you need to review an old file quickly without switching your working copy.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4) List directory contents for a revision with svn list<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php language-bash\">svn <span class=\"hljs-keyword\">list<\/span> -r <span class=\"hljs-number\">120<\/span> path\/to\/directory\nsvn <span class=\"hljs-keyword\">list<\/span> -r <span class=\"hljs-number\">120<\/span> https:<span class=\"hljs-comment\">\/\/svn.example.com\/repo\/trunk\/<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Use <code>svn list<\/code> when you need to verify whether a file existed in a directory at a given revision.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Best practices and common pitfalls<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Start with <code>svn log<\/code> to narrow scope, then use <code>svn diff<\/code> for exact changes.<\/li><li>Use file or subdirectory paths to reduce noisy history from unrelated parts of the repository.<\/li><li>Remember that SVN revision numbers are repository-wide, not per-file counters.<\/li><li>If output is empty, verify that the path existed at that revision and that you have access rights.<\/li><li>Record revision numbers in incident or change notes so later audits are repeatable.<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Subversion keeps a complete change history, but getting useful answers depends on choosing the right command. This guide shows when and how to use svn log, svn diff, svn cat, and svn list with practical examples.<\/p>\n","protected":false},"author":1,"featured_media":4339,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[23],"tags":[4044,4050,4046,1122,4047,2624,3113,593,394,4045,4048,4049,213],"class_list":["post-290","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-svnsubversion","tag-examin","tag-examin-svn-history","tag-examining-history-in-subversion","tag-guide","tag-historical-data","tag-history","tag-how-to","tag-process","tag-subversion","tag-subversion-history","tag-svn-commit-history","tag-svn-history-examining-command","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/290","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=290"}],"version-history":[{"count":6,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/290\/revisions"}],"predecessor-version":[{"id":79126,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/290\/revisions\/79126"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/4339"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=290"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=290"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=290"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}