Admin Life Errors, Fixes, and Encounters


adding and deleting files in subversion

### Quick SVN script for automatically adding and deleting files
### Here's a quick bash script for automatically adding and deleting files in subversion. Don't you hate having to list each one individually? Or getting all those messages that say, "the file has already been added" when you just do svn add my/directory/*. Even more of a pain if you selectively delete a bunch of files.

# svn status | grep '^?' | sed -e 's/^? /svn add "/g' -e 's/$/"/g' | sh
# svn status | grep '^!' | sed -e 's/^! /svn delete "/g' -e 's/$/"/g' | sh

###commit a single file (CheckIn)
# svn ci index_body.php -m 'New design changes'


add user subversion

Need to add a user to subversion but it overwrites the existing password list of users? It happens to me, maybe there's an extra trigger I need to specify... I don't know but this works!

Add user_name with password user_password_123 to htpasswd_test
# /usr/local/apache2/bin/htpasswd -c -m -b /usr/local/ss_repo/conf/htpasswd_test user_name user_password_123
Adding password for user rsamuel

Get the username & password from the file (copy it)
# vi /usr/local/ss_repo/conf/htpasswd_test

In our case

Paste it into the REAL htpasswd file
# vi /usr/local/ss_repo/conf/htpasswd


Save and exit

That it's, now a new user has been added into subversion