Skip to main content

Deals You Can't Miss

1 Year Subscription

SVN FAQ(s)

An avid reader I am, I encourage you to read at least a book on every technology you put to use to in your project(s). Also, it is indeed a good practice to keep reading QnA forums like in http://stackoverflow.com/questions/.

My favourite book for SVN (subversion) is Pragmatic Guide to Subversion.
Pragmatic Guide to Subversion

So here we go with our list of FAQs in SVN. Should you like to add solutions to the problems you have had faced in this page, I encourage you to please use the comments section of this page. I shall sooner or later add it to the list of "Question and Answers" that we have for SVN, below.
  1. How to get the list of files that become a part of a particular commit in SVN repository?<br/> For every commit to svn, the repo generates a REVISION number. Using this revision number, we can fire the following command to get the list of files
    svn log -qvr <revision>
    (Also, read stackoverflow.com for more details)
  2. How to find the difference in file content between two revisions? <br/> Syntax:  svn diff -r <PREV_REVISION>:<NEW_REVISION> <FILE_NAME>
    Example: svn diff -r 3277:3278 app/models/account.rb
  3. How to get the list of files changed between two revisions? <br/> Syntax:  svn diff -r <PREV_REVISION>:<NEW_REVISION> --summarize
    Example: svn diff -r 3277:HEAD --summarize will list the files modified\added\deleted files since revision 3277 till current revision in the repo
  4. How to see the changes between two revisions, not mere list of file changes but the actual content difference between the revisions?
    Syntax:  svn diff -r <PREV_REVISION>:<NEW_REVISION>
    Example: svn diff -r 3277:3276
  5. How to see the last 'N' commit logs? 
    Syntax:  svn log -l <limit>
          (or)  svn log --limit <limit> 
    Example: svn log -l 10 will display the last 10 commits' log messages
  6. How to see the last 'N' commit logs along with the list of [added\deleted\modified] files that were committed? 
    Syntax:  svn log -vl <limit>
          (or)  svn log --verbose --limit <limit> 
    Example: svn log -vl 10 will display the last 10 commits' log messages along with the list of modified files that were committed with each such commit.
  7. How to undo a commit in svn, when a commit's revision number is known? 
    Syntax:  svn merge -r <UNDO_REVISION>:<UNDO_REVISION-1> <URL of trunk\branch where commit needs to be undone>
    Example: svn merge -r 3278:3277 http://mysvnA1.thoughtworks.com/seesaw/branch/release_3.04/seesaw will undo the 3278 commit changes in your local code base which requires to be committed with perhaps the commit message like 'Commit to undo revision 3278 changes' 
  8. How to merge a branch to a trunk (or vice-versa)? 
    Syntax:  svn merge -r <REVISION_From#>:<REVISION_To#> <URL of the source branch (or trunk) from where the changes are taken>
    Example: svn merge -r 250:HEAD http://mysvnA1.thoughtworks.com/seesaw/branch/release_3.04/seesaw will pick the changes from r250 to the last of the revision and merge all those changes to your local copy of trunk, assuming that you ran the above command from your local working directory that points to remote trunk. You may now review the local changes as a result of merge. If you are not satisfied with the changes you can revert it. If you are however happy with the changes you may commit them to the remote trunk. 
  9. [More to come...]




Additional Reading Links:

  • Read Chapter 9 - Subversion Complete Reference, at svnbook



FYI: There exists better alternatives to SVN as central repository. Some of them being Git, Mercurial etc.

Some cool books on Git, that I'm aware of are:
Pro Git     Version Control with Git: Powerful Tools and Techniques for Collaborative Software Development     Pragmatic Version Control Using Git (Pragmatic Starter Kit)     in that order. If in your experience there are better books that helped you understand Git better, please do share your experience in the comments section.

Mercurial is just another alternative to svn (or actually to Git). The one book that I'm aware of for this tool is Mercurial: The Definitive Guide (Animal Guide).


My Popular Posts

Ten Commandments of Egoless Programming

We are nothing but the values we carry. All through my life thus far, I tried to influence people around me with the virtues I value. Thanks to some good reading habits I had inculcated, and the fortune of being in good community of peers and mentors alike, I managed to have read some real good books. This post is about the 10 commands of egoless programming in Weinberg's book. I shall explain the commandments based on my experience here. So very many decades ago, Gerald M. Weinberg authored  The Psychology of Computer Programming . In it, he listed The Ten Commandments of  Egoless Programming , which remains relevant even today for us as not just programmers but as team-members. Weinberg is regarded as a pioneer in taking a people-centric approach to computing, and his work endures as a good guide to intelligence, skill, teamwork, and problem-solving power of a developer. When they appear to inspire and instruct, we find that they can apply to just about every business area, and e

Should I buy refurbished laptop from Amazon?

This post is based on my experience with amazon.in and guess it to be true on all other platforms as well. At least you can check out and verify for these pointers before you make that decision to buy renewed/refurbished laptop on Amazon with your hard earned money. I see this question propping up in several forums and on many different occasions. In the recent past, I had my 5 year old dell laptop that gave up because its motherboard failed. One of the options that I had in my mind was to re-use the HDD and the 16GB DDR4 RAM of that old laptop in the one that I purchase next as secondary.  I had come to a conclusion that it is not worth buying a refurbished/renewed laptop at all. Why? For the following reasons, most of which I see as BIG #RedFlags: You got to remember that Amazon provides a platform for 3rd party sellers to sell their products as well. So in your search for refurbished laptops you wouldn’t want to choose some random 3rd party seller who Amazon doesn’t endorse. You cou

Multi-tenant Architectures

  Multi-tenancy Application Deployment Architecture could be modeled in 4 broad ways: Separate Apps & Separate Databases Shared Apps & Shared Databases Separate Apps & Shared Databases Shared Apps & Separate Databases There is no right or wrong here. It's about choice and consequence that you should consider taking into your business context and constraints. In this post I intend to jot down a some key points to keep in mind for each of these multi-tenant architecture. These are more of quick notes for my quick reference, a cheat-sheet of sorts when I have to make choices. And I guess this can come handy to you too in your wise decision making. Separate Apps & Separate Databases Easiest to implement from development and deployment stand-point. Just automate the deployment infrastructure for every tenant for quick set-up. Most expensive of all the models from infrastructure cost stand-point. Relatively longer deployment t