28

I'm trying to commit a new version to my SVN repository but am met with this error:

svn: 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 are set, and no 'editor-cmd' run-time configuration option was found new-computers-computer:trunk newcomputer$

What's wrong?

2
  • @Ether, that error message means nothing if you're new to SVN or the command line. Check out the accepted answer by Blackcoat to see a helpful answer. Commented Aug 27, 2013 at 2:55
  • 1
    export SVN_EDITOR=vi Commented Sep 12, 2019 at 15:41

5 Answers 5

37

Justin,

Every time you commit with Subversion, you need to write a summary of what is being committed (i.e. the commit message). The error is because Subversion is trying to launch a text editor so that you can write a commit message, but the editor is never being launched. Setting the SVN_EDITOR in your .bash_profile will do the trick. Here are some detailed step-by-step instructions on how to set vim as the default editor used by svn: Original link dead, replaced with archive.is mirror

Alternatively, as suggested in error message, you can load a commit message from an existing file with -f, or pass in a message with -m.

Examples:

svn commit -m "Fixed a regression that prevented pigs from flying (resolves issue #123, but causes strange behavior elsewhere)" svn commit -f /path/to/a/file/with/a/long/commit/message.txt 
Sign up to request clarification or add additional context in comments.

3 Comments

In your .bash_profile, add: export EDITOR="$HOME/bin/mate -w"
Similarly, you can set Sublime as your default by doing export EDITOR='subl -w'. For full details on command line setup for Sublime, see sublimetext.com/docs/2/osx_command_line.html
Message with -m will resolve the problem. svn delete my/branch/path -m "type your message here" this is the branch delete command with message.
18

If you want to set default editor that will be used every time you run

svn commit 

Try the following command in the shell:

export SVN_EDITOR=nano 

This will set nano as the text editor for commit messages. From now on, when you call svn commit without the -m flag, nano will open. Upon closing nano, SVN will continue to commit.

2 Comments

And what will happen? Please consider to add a description to your answer.
basically when you need to set default editor, you should use command from above.
2

I also had the same issue, however it was on Windows. I was able to resolve the issue by using -m (--message) and providing the commit message.

I also tried using cygwin with a commit message and that worked.

Comments

0

I had a similar problem while trying to import a not versioned code into a new repository, based on the answers posted on this question i was able to solve my problem (thank you guys).

I am sharing the command i used to import a local project to SVN on using apache/http:

Where TestCodeDir is the project and hasn't been versioned yet.

svn import /var/svn/TestCodeDir http://localhost/svn/TestCodeDir -m "Initial Commit" 

Note: You must to have your apache server well configured and it must to be running.

I hope this could help someone.

Comments

0

I had the same problem while doing:

svn copy $svn_source_path $svn_destination_path 

I was missing adding the -m "log msg" i.e.

svn copy $svn_source_path $svn_destination_path -m -m "Test tag creation" 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.