How to set SVN_EDITOR environment variable in Windows Server

Photo of author
Written By Jan Reilink

Windows Server system administrator & enthusiast.

On a newly installed workstation or server, you might encountered the following subversion error when you commit a change:

svn: None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set, and no ‘editor-cmd’ run-time configuration option was found.

So you haven’t set the default SVN_EDITOR environment variable, yet. The error message continues:

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

You can fix this error by setting a SVN_EDITOR environment variable in Windows. To set SVN_EDITOR temporarily, issue the following command on your cmd.exe command line;

set SVN_EDITOR=notepad.exe
Code language: JavaScript (javascript)

You can use SETX to set a permanent environment variable in Windows:

setx SVN_EDITOR C:\Windows\System32\notepad.exe
Code language: CSS (css)

Or to set %PATH% environment variable in Windows Server Core:

SETX PATH "C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PowerShell\7\;C:\Program Files (x86)\dotnet\;C:\Program Files\dotnet\;C:\Windows\system32\inetsrv"
Code language: JavaScript (javascript)

In PowerShell, see the [Environment]::SetEnvironmentVariable command.

Of course you can also set an editor-cmd configuration in your subversion config file. Then you wouldn’t have to set an environment variable. Locate the svn config file in your %USERPROFILE% ($env:APPDATA\subversion\config):

Windows Terminal open subversion config

And add/change the editor-cmd line

[helpers] editor-cmd = C:\Windows\System32\notepad.exe
edit editor-cmd line in svn config

Set SVN_Editor environment variable in Bash (Linux)

export SVN_EDITOR=vim
Code language: JavaScript (javascript)

To permanently set this environment variable, put the below line in your ~/.bash_profile file:

vim ~/.bash_profile export SVN_EDITOR=vim # save file
Code language: PHP (php)

and execute source ~/.bashrc to apply the changes immediately.


Did you like: How to set SVN_EDITOR environment variable in Windows Server

Then please, take a second to support Sysadmins of the North and donate!

Your generosity helps pay for the ongoing costs associated with running this website like coffee, hosting services, library mirrors, domain renewals, time for article research, and coffee, just to name a few.



Hi! Join the discussion, leave a reply!