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
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
Feb 08, 2021

How does agile apply to an entire organization?

Enterprise Agile Planning
Before we dive into the main subject of this blog post, it is importan ...
Read More
Feb 03, 2021

It took a pandemic to realize why digital transformation actually matters

Enterprise Agile Planning
Before anyone had ever heard of COVID-19, businesses across the globe ...
Read More
Jan 27, 2021

Improve visibility, reduce costs, and take back control of your scaled out container and cloud deployments with the latest releases of Digital.ai Agility and DevOps solutions

Enterprise Agile Planning
We’re thrilled to announce the latest releases of our Digital.ai Agili ...
Read More
Contact Us