将新版本提交到SVN信息库时提交失败错误
我正在尝试将新版本提交到我的SVN存储库,但遇到此错误:
I'm trying to commit a new version to my SVN repository but am met with this error:
svn:提交失败(详细信息如下:
svn:无法使用外部编辑器获取日志消息;考虑设置$ SVN_EDITOR环境变量或使用--message(-m)或--file(-F)选项
svn:没有设置环境变量SVN_EDITOR,VISUAL或EDITOR,并且没有发现'editor-cmd'运行时配置选项
new-computers-computer:trunk newcomputer $
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$
出了什么问题?
Justin,
每次使用Subversion提交时,您需要写一份提交内容的摘要(即提交消息)。该错误是因为Subversion试图启动文本编辑器,以便您可以编写提交消息,但从未启动过该编辑器。在您的.bash_profile中设置 SVN_EDITOR
即可解决问题。以下是有关如何将vim设置为svn使用的默认编辑器的详细分步说明:原始链接已失效,已替换为archive.is镜像
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
或者,如错误消息中所建议,您可以使用 -f
从现有文件中加载提交消息,或传递一个带有 -m
的消息。
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
.
示例:
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