换行添加到git的命令行提交-m [英] Add line break to git commit -m from command line

查看:160
本文介绍了换行添加到git的命令行提交-m的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用命令行的git,并尝试添加一个换行符,以提交信息(使用混帐提交-m)没有进入 VIM

I am using git from the command line, and trying to add a line break to the commit message (using git commit -m "") without going into vim.

这可能吗?

推荐答案

当然,它是如何做取决于你的外壳。在bash中,你可以使用单引号的消息左右,而刚刚离开报价开放,这将使bash提示符的另一条线,直到您关闭报价。像这样的:

Certainly, how it's done depends on your shell. In bash, you can use single quotes around the message, and just leave the quote open, which will make bash prompt for another line, until you close the quote. Like this:

git commit -m 'Message
goes
here'

另外,你可以使用一个here文档

Alternatively, you can use a "here document":

git commit -F- <<EOF
Message
goes
here
EOF

这篇关于换行添加到git的命令行提交-m的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆