SVN提交信息中含有换行符的问题

18

我正试图在提交信息中添加换行符。

我该如何换行?我已经尝试过:

svn commit -m "Issue \n solution" file.js 

但显然它没有起作用。


如果您想从命令行执行此操作,可以使用PowerShell: PS C:\ temp> svn commit -m“问题`n解决方案”file.js - il--ya
2个回答

23

或者,您也可以不指定-m(也不是-F),然后将显示一个编辑器,您可以在其中输入消息:

将工作副本中的更改发送到存储库。如果您没有使用--file(-F)或--message(-m)选项提交时提供日志消息,则svn将为您启动编辑器以撰写提交消息。请参见“配置”部分中的editor-cmd列表条目。

http://svnbook.red-bean.com/en/1.7/svn.ref.svn.c.commit.html


很高兴我能帮到您。请将其标记为已接受的答案,这样未来的读者就会知道哪些方法有效。完全透明:我会因此获得一些声望值 :) - mnagel
谢谢,我收到了以下信息:svn: E205007: SVN_EDITOR、VISUAL或EDITOR环境变量都未设置,并且没有找到“editor-cmd”运行时配置选项,但我通过这个答案解决了问题https://dev59.com/01fUa4cB1Zd3GeqPKbJP - ronnyfm
我在CLI中使用了"export SVN_EDITOR=subl",现在当我需要多行编辑提交信息时,我使用sublime。 - Marian Zburlea
有另一个更简单的答案,无需使用其他编辑器,请查看https://dev59.com/GnRB5IYBdhLWcg3wF0HH#26548248 - Quang Tran
svn 提交 -F 文件路径.扩展名 - Reynald0

5

--file (-F) FILENAME

Uses the contents of the named file for the specified subcommand.

Different subcommands do different things with this content. For example, svn commit uses the content as a commit log message, whereas svn propset uses it as a property value.


svn 提交 -F 文件路径.扩展名 - Reynald0

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接