Skip to content

Instantly share code, notes, and snippets.

@saltybeagle
Created June 17, 2011 13:46
Show Gist options
  • Save saltybeagle/1031440 to your computer and use it in GitHub Desktop.
Save saltybeagle/1031440 to your computer and use it in GitHub Desktop.
Script to switch all svn.php.net checkouts from http to https
for dir in `ls -1 */.svn/entries | xargs grep -H -l svn.php.net | grep -E -o "^[^\/]+"`; do
svn switch --relocate `svn info $dir | grep ^Repository\ Root | cut -f 3 -d ' '` `svn info $dir | grep ^Repository\ Root | cut -f 3 -d ' ' | sed 's/http:/https:/'` $dir
done
@saltybeagle
Copy link
Author

In Eclipse I have every project checked out in ~/workspace/ so every project on http://svn.php.net would need to be switched to https://svn.php.net. This shell script handled all the svn switch –relocate statements for me.

It may be best to make a backup of your project directories, especially if you have local uncommitted changes. This script works on bash-like command lines, such as Mac OS X.

cd ~/workspace and run ./svnswitchall.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment