Subversion Techniques

Intro

Subversion drives me nuts! Here are a few notes to solve issues I have come across from time to time.

How to add a folder to subversion

Recently, I needed to upgrade the system folder of codeigniter from ver. 1.7.1 to 1.7.2. Only the system folder needed to be updated. Somehow my copying removed all the .svn folders (argh!) and I had to recreate the new folder in subversion. Here’s how I did it:

  1. Remove the folder with svn delete {folder_path}.
  2. Commit first! svn commit -m “deleting old outdated folder…”
  3. Copy the new folder into place. cp -r {new_folder_path} {old_folder_path)
  4. Add new folder to repo. svn add {folder_path}
  5. Commit to add back that folder.

Change Hostname on a Checked-out Copy

From the root of your subversion checked-out copy:

find . -iname 'entries' -exec sed -i -e 's/{old hostname or ip}/{new hostname or ip}/g' {} \;

Remove from repository without deleting local copy

svn delete --keep-local file_name

Remove all subversion files from a folder

find . -name ".svn" -type d -exec rm -rf {} \;

Inadvertingly deleted .svn folder

svn checkout --depth files --force file:///path/to/repo  folder/with/missing/svn

Post a comment