Skip to main content
Enterprise Agile Planning Image

This post is from the CollabNet VersionOne blog and has not been updated since the original publish date.

Last Updated Apr 05, 2013 — Enterprise Agile Planning expert

Tips on Subversion

Enterprise Agile Planning

I recently had to work on multiple issues simultaneously. After resolving the first issue I realized that I had committed the changes to a wrong branch. My challenge was to remove these changes from the code before further damage happens and that too in a quick time. I had few options in mind to resolve the situation; I can either remove all my changes in my next commit or revert back my mistaken commit. The best possible way I felt was to go with my second option i.e. undo my mistaken commit. Here are some tips on subversion to illustrate how I did it.

Undo an unwanted/mistaken commit

svn merge -r : http://example.com/repo

or

svn merge -c http://example.com/repo

revnum is the revision number of the unwanted/mistaken commit.

A few days back, I was working with one of my friends trying to fix a bug. I was using my friend’s laptop who, incidentally, was working on the same code base. My first challenge was to fix the code, once I did that I was ready to go ahead with committing the changes to the repo. But before I could realize that subversion took his username as author from the .subversion directory, the changes got committed. I fix the issue by using the below command:

Change the author of the commit:

svn ps –revprop svn:author “newauthor” -r http://example.com/repo

I would like to share an interesting command which I think is a cool feature in subversion: Resurrecting deleted items: I realized the importance of this command when I was working with my team on a project. I accidently deleted a file /trunk/secret in revision 10. After a few months, in revision 80, I had a situation to go back to the revision 10 file. I used the below command to resurrect the file:

svn copy -r9 http://example.com/trunk/secret ./secret

How about you? Have you been in a similar situation? What would you have done different? It would be particularly interesting if you can (concisely!) describe a situation that really demands similar behavior.

More from the Blog

View more
May 31, 2021

Agile change management processes are key to delivering software faster

Enterprise Agile Planning
With its emphasis on delivery value faster, agile product management s ...
Read More
May 03, 2021

Bringing the agile planning approach to your whole business

Enterprise Agile Planning
The events of the last 12 months have demonstrated that the only sure ...
Read More
Apr 08, 2021

Making IT services more agile

Enterprise Agile Planning
The agile revolution completely transformed how we create digital prod ...
Read More
Feb 14, 2021

Reflecting on the 20th anniversary of the Agile Manifesto

Enterprise Agile Planning
Over the past 20 years, it’s been amazing to watch an idea from ...
Read More
Contact Us