Posts Tagged ‘svn’

How to delete .SVN files/directories

Thursday, August 13th, 2009

This is so common situation when somebody decides to copy a directory that contains SVN files which also has locally modified files.
Therefore a clean export won't do the job.
Here is what I do to clean up the new folder from the SVN files.

This command will display all the .SVN folders starting from the current folder.

Be yourself i.e. not root :D just in case.

find . -type d -name '*.svn' -print

Example Output:

./js/.svn
./templates/.svn
./.svn
./css/.svn
./images/.svn

What I do is check the folders visually and then use my editor to search & replace:
"./" and replace it with "rm -rf ./"

Result:

rm -rf ./js/.svn
rm -rf ./templates/.svn
rm -rf ./.svn
rm -rf ./css/.svn
rm -rf ./images/.svn

Then I paste this in the console window.

rm is a dangerous command so be careful!
Your precious work could be gone in a fraction of a second!

How to export svn editor

Wednesday, April 22nd, 2009

Have you seen this message lately ?

csvn: Commit failed (details follow):
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
svn: None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set, and no 'editor-cmd' run-time configuration option was found

Here is how to export SVN_EDITOR variable.

Feel free to change the editor to pico, nano etc.

echo export SVN_EDITOR=vi >> ~/.bash_profile

Logout and then Login again to *see* the change.
By *see* I mean that you have to do execute the following command and the editor of your choice should be run for you:

svn ci

Related:

How to ignore whitespaces in SVN diff

Tuesday, December 16th, 2008

Recently I setup my Zend Studio 5.5.1 to treat each file as a UNIX filetype.

This however made SVN to produce large diff files containing whitespaces.

Ignore whitespaces by using an external diff program.

[code]
svn diff --diff-cmd diff -x -uw
[/code]

You can also add "di" alias this to your ~/.bashrc file.

[code]
alias di='svn diff --diff-cmd diff -x -uw' # ignore whitespaces
[/code]

Credits go to: Akatombo Media

http://www.akatombo.com/en/comments/ignore_whitespace_in_a_subversion_diff/

Thanks.