walter
walter

Reputation: 823

How to backup updated source code files

I am using svn as source control with AnkhSVN 2 for Visual Studio 2010. Very often I am working on one ticket than switching to work on another ticket without completing first one. Is there any quick way to backup updated files for first ticket? This will simplify coding by managing only related changes.

Upvotes: 3

Views: 159

Answers (3)

JB Nizet
JB Nizet

Reputation: 691715

You should use a feature branch for each ticket, and reintegrate each branch into trunk once finished. Just make sure to read the SVN book to understand the best practices when working with feature branches, and particularly to regularly merge from trunk to the feature branch, before finally reintegrate the feature branch into trunk with the --reintegrate option.

You could also create a patch, save it somewhere, revert everything, then start working on ticket2. But it's fragile: you'll forget where your patches are, lose them, or have a hard time applying them because of conflicts caused by the work on the second ticket. And it's also harder to switch from one ticket to another. Feature branches are the most appropriate solution for this, IMHO.

Upvotes: 0

Jamie Dixon
Jamie Dixon

Reputation: 54001

The question I'd be asking is "Does the software build". If it does, check it in to source control. If it doesn't, get it into a state where it does, and check it in to source control.

You don't have to check into the trunk, you can always have a branch that you use for intermediate code which then gets checked into the trunk when you've completed the tickets.

Upvotes: 0

Shaun Wilde
Shaun Wilde

Reputation: 8358

You could

  1. create a patch file for the svn branch you are working on
  2. then revert your changes
  3. work on new ticket and commit
  4. reapply patch

Upvotes: 4

Related Questions