Skip to main content
Enterprise Agile Planning icon with arrows

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
Digital.ai Government Cloud
Apr 12, 2022

Digital.ai Government Cloud receives FedRAMP Authorization through sponsorship from the United States Department of Veterans Affairs

Enterprise Agile Planning
Flagship Digital.ai Agility solutions can effectively scale agile deve ...
Read More
Nov 22, 2021

What are the qualities of highly effective agile teams?

Enterprise Agile Planning
A team is the core unit of productivity in an agile organization. Wher ...
Read More
Nov 15, 2021

How an open-first attitude revolutionized government tech development

Enterprise Agile Planning
Public perception of government is often that it is slow-moving, reluc ...
Read More
cross functional
Nov 08, 2021

6 best practices for building resilient cross-functional teams

Enterprise Agile Planning
Agile frameworks prize the quality of resilience within every facet of ...
Read More
Contact Us