简体   繁体   English

在git中使用rebase时添加多行提交

[英]Add multiline commit when using rebase in git

I want to change my single line commits to multiline commits adding more details. 我想将单行提交更改为多行提交,以添加更多详细信息。 I tried using git rebase -i which opens up a file in nano where I can reword my commits. 我尝试使用git rebase -i来打开nano中的文件,在其中我可以reword提交提交。 However, adding multiple line commits there doesn't work. 但是,在那里添加多个行提交是行不通的。

Editing the commit message in the file with the list of commits does not do anything anyway, the commit messages are only there to identify the commits by more than the SHA. 无论如何,使用提交列表在文件中编辑提交消息都不会做任何事情,提交消息仅是用来标识提交的,而不仅仅是SHA。

If you selected the reword stanza for a commit and continue, then when the commit in question is applied, your commit editor (nano in your case) opens with the commit message just like when you commit normally and you can put any commit message in there. 如果您为提交选择了reword节并继续,那么在应用有问题的提交时,您的提交编辑器(在您的情况下为nano)打开时会带有提交消息,就像您通常进行提交时一样,您可以在其中放置任何提交消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM