Tuesday, 10 August 2010

Merging several changes into an incomplete svn tree

I have been using Subversion (SVN) for version control of my files for some time now, but recently I was away for half a year without being able to commit changes to the SVN server. In addition, I only save some of the files in my folders, to avoid versioning large binary files. These are some of the things I learned trying to merge all my changes into the incomplete SVN tree:
  • To avoid adding certain files, edit the global-ignores parameter in the svn config file (found under ~/.subversion/ on my Ubuntu installation) to ignore files matching certain patterns, for example *.pdf
  • To update an incomplete folder structure by copying in files from a complete folder structure, use the '-u' switch with the copy command, together with the '-r' switch for recursive copying: cp -u -r compTree inCompTree
  • To check if files or folders in the current folder are versioned (registered in the svn system), use svn status --depth=immediates
  • If you want to restructure the folder tree, it's easier to do this directly in the repository rather than changing the structure of the working copy and then commiting (I used the RabbitVCS repository browser, but it's possible to do via the command line)
  • Finally, it's often better to check out a subfolder of the repository rather than the complete tree - it saves both time and disk space. Example: svn checkout svn://server/Topfolder/Subfolder Subfolder will only check out the "Subfolder" folder and create a local copy.


Post a Comment