Some smart dude at the office managed to commit a whole bunch of 'backup' files (they start with ._
) to our subversion server.
Preferably I would like to delete these files using some basic bash script instead of going through the repository manually.
Is there any way I can get a list of all subversion versioned files inside a directory so I can do some basic grepping / svn deletes?
edit:
'svn list' isn't recursive and also seems to list directories, I need the kind of behavior like 'find'.
second edit:
Ok, the -R flag can make 'svn list' recursive... but how do I strip out directories?
svn list -R
lists all files and directory recursively
If it's only in one commit (or series of commits) then use svn merge to undo it.
If the user has been doing it across several commits and you're on Linux:
First check that this properly lists the files you want to delete:
find . -name '._*'
Then actually invoke svn to delete them:
find . -name '._*' -exec svn rm {} \;
Check svn status, commit if good.
Disclaimer: I have not tested the commands so beware.
I think those are Mac backup files it makes automatically.
how do I strip out directories?
The key is to observe the directories will end with a slash.
You can then use grep.
svn list -R my_svn_dir | grep -v '/$'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With