Deleting a folder from svn repository
LinuxSvnTerminalLinux Problem Overview
I sometimes make mistakes with svn and have folders stuck in my repository. I want to remove these folders but I cannot figure out a way to do this. Keep in mind I am very new with SVN. I am running this command from apple terminal:
sudo svn delete http://www.yourrepository.com/svn/folder
I get the message :
Anthony-Work-Mac-Pro:htdocs APN$ sudo svn delete http://www.yourrepository.com/svn/folder
svn: Could not use external editor to fetch log message; consider setting the $SVN_EDITOR environment variable or using the --message (-m) or --file (-F) options
I have also tried svn delete
, and svn rm
.
What do I need to do?
Linux Solutions
Solution 1 - Linux
Looks like a commit message is required, and you do not have your system configured to launch an editor for you to add one (without specifying on the command line).
Try this:
svn delete http://www.yourrepository.com/svn/folder --message "Deleting"
Solution 2 - Linux
To avoid similar messages in the future, add something like export SVN_EDITOR="/usr/bin/vim"
to your .bash_profile (or something similar for your Mac :))
Solution 3 - Linux
You can use 2 step delete and commit for this as well. No need to use repository URL.
svn delete filename1 filename2 forldername1
svn commit -m "[Message] Unwanted files and folder."
Solution 4 - Linux
I use powershell and the command svn list -R
to search the repo recursively for folders I want to delete and then pipe the results into findstr
or similar, like:
svn list -r HEAD -R | findstr /R /I "\/obj\$/ \/bin\/$" | % { svn delete --force $_ }
This uses regular expressions to search. Each /folder/ you want to find in the repo is separated by a blankspace, not the usual | (bar) character used in regular expresions.
Good idea to try it out first with just:
svn list -r HEAD -R | findstr /R /I "\/obj\$/ \/bin\/$"
Note to be absolutely sure what you are doing before commit.