title: Switching between trunk and branch with symbolic links
body: <p>(This question earned me a tumbleweed badge on <a href="https://superuser.com/questions/442983/switching-between-trunk-and-branch-with-symbolic-links">SuperUser</a> but I was advised to try it here instead)</p>
  
  <p>I'm working on a major branch on my LAMP development server, but I frequently need to make minor but urgent updates to trunk.</p>
  
  <ul>
  <li>I want to use the same local url for whichever working copy I'm in (don't want multiple sites - laziness, bookmarks, maintenance.)</li>
  <li>I don't want to have to commit unfinished work in the branch just so that I can switch to trunk for five minutes.</li>
  <li>I'm using subversion, so I don't have the equivalent of git stash.</li>
  </ul>
  
  <p>I am experimenting with serving my local site from a symbolic link (foo), which I can then rewrite to point at branch or trunk. This allows me to switch backwards and forwards without worrying about uncommitted changes, means that I can use the same bookmarks, path aliases, etc</p>
  
  <pre><code># svn working copies for trunk and branch
  /sites/footrunk/
  /sites/foobranch/
  /sites/foo -&gt; foobranch  #symbolic link
  
  # eg to switch to trunk
  cd /sites;
  ln -s footrunk foo_tmp &amp;&amp; mv -fT foo_tmp foo
  cd -; 
  sudo service apache2 restart
  </code></pre>
  
  <p>My problem is that apache occasionally gets confused immediately after a switch, and seems to be holding onto empty, old or duplicate (cannot redeclare class error in php?) versions of files. Restarting apache seems to resolve everything, but there are warning bells going off in my head.</p>
  
  <p>Is this a reasonable use of symbolic links, or am I just saving up problems for the future?</p>