Shelve in TortoiseSVN?

39,188

Solution 1

Shelving in SVN is starting to roll out with version 1.10, see Release Notes

Solution 2

I don't believe that SVN has this feature built into the server product. I also don't believe anything like this emulated in any clients that I have used, including TortoiseSVN.

To get around this problem, I have resorted to using a DVCS such as Git or Mercurial, to allow me to branch/merge/shelve locally before pushing the content back to SVN. It's arguably a bit of a kludge, but it works really well.

Solution 3

If you understand how SVN branches work, emulating Shelve in SVN is a no-brainer:

  1. Create a branch in the repository (on the server)
  2. Switch your local copy to it
  3. Commit your changes to the new branch
  4. Switch your local copy back to the trunk

When you are ready to get back to your shelved changes ("unshelve"), simply merge the shelf branch back to your local copy.

If you don't know command-line SVN nor Tortoise SVN well enough to do the above, here's a super detailed step-by-step instruction on how to do it in Tortoise SVN:

  1. Do "SVN Update" to update your working copy to the latest version of the trunk. This way the only differences between your local copy and the trunk are your changes.
  2. From the context menu select "Branch / Tag"
  3. "HEAD version in the repository" option is selected by default. Keep that.
  4. Change the "To Url" to specify branch name, e.g. http://server/repository/project1/branches/shelf1
  5. Check the "Switch working copy to new branch/tag" box
  6. Click Ok to create the branch and switch to it
  7. Do "SVN Commit..." and commit your changes to the newly created branch
  8. From the context menu select "Switch..."
  9. Change the "To URL" to the trunk URL e.g. http://server/repository/project1/trunk
  10. Click Ok to switch back to the trunk

See this link for even more details and the command-line equivalent of the above:
Shelves in Subversion

Solution 4

TortoiseSVN 1.10 now supports shelving: https://tortoisesvn.net/docs/nightly/TortoiseSVN_en/tsvn-dug-shelving.html

Solution 5

Another option is to use the 'Create patch' facility in TortoiseSvn to create a patch file and revert changes. The patch file can later be reapplied to get back where you were.

You may still end up with some sticky merges if you have to update the working copy revision though.

Share:
39,188
Larsi
Author by

Larsi

http://twitter.com/bradleach Brad is a software developer/leader/mentor. He is passionate about all things developing, and is a vivacious reader. He believes user experience to be vital.

Updated on November 10, 2020

Comments

  • Larsi
    Larsi over 3 years

    I've moved from TFS to SVN (TortoiseSVN) with my current company. I really miss the "Shelve" feature of TFS. I've read various articles on how to "Shelve" with SVN, but I've read nothing that gives a very simple experience to "shelve" work.

    Ideally, I'd like extra items added to the TortoiseSVN context menu - "Shelve" & "Unshelve". "Shelve" would remove the current shelve-set, and upload the working directory under a suitable path defined by user options. "Unshelve" would merge the set with the working copy.

    Does something like this exist? Can anyone suggest any ways to "hack" this feature in the GUI?

    Note: The following link doesn't really achieve the user experience I was looking for:

    Shelving Subversion

    One of the greatest things about TFS Shelve is how easy it is to use...