PowerShell one-liners for svn

A bit of CLI love (and I'm sure my readers will correct me fairly quickly with something much smaller and better!), for those like me that wish they never had to use tortoise.

Adding all files that are not in the repository

svn st | %{ if ($_ -match "\?\s+(.*)") { svn add $matches[1] } }

Removing the dreaded bin and obj folders if you did an add by accident

ls -i bin,obj -recurse | % { svn revert $_ -R }

And to exclude all the stuff you put in your .svnignore (and that one works with any shell)

svn propset svn:external . -F .svnignore -R

Enjoy!

Ads

Comment