git commit -a / 纳米
由于某种原因,当我尝试运行 git commit -a 时,我没有收到 Nano 底部的常用控件,也无法保存我编辑的提交消息。输出是这样的:
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: app/controllers/photos_controller.rb
# deleted: app/views/comments/edit.js.erb
# deleted: app/views/facets/_old_menu.html.haml
# modified: app/views/photos/uploaded_photo.html.haml
# deleted: config/initializers/delayed_job_config.rb
# deleted: public/images/blue_panel_column.png
# deleted: public/images/embed/add_feature_button.png
~
~
~
~
".git/COMMIT_EDITMSG" 39L, 1947C
我已经仔细查看了这一点。如果这可以解释的话,我必须手动删除 .git/index.lock 。预先感谢您的任何建议。
For some reason when I try to run git commit -a I don't receive the usual controls at the bottom of nano and cannot save my edited commit message. The output is something like this:
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: app/controllers/photos_controller.rb
# deleted: app/views/comments/edit.js.erb
# deleted: app/views/facets/_old_menu.html.haml
# modified: app/views/photos/uploaded_photo.html.haml
# deleted: config/initializers/delayed_job_config.rb
# deleted: public/images/blue_panel_column.png
# deleted: public/images/embed/add_feature_button.png
~
~
~
~
".git/COMMIT_EDITMSG" 39L, 1947C
I've looked all over for this. I have had to manually remove .git/index.lock if this might explain it. Thanks in advance for any advice.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你好,只是一些想法,
你尝试了 vi 风格的命令来查看
如果 git 已恢复使用
六? [Esc :x]
如果您的提交消息小而简单,就像您的提交一样,您可以使用
git commit -a -m "你的消息在这里"
希望是这样的一些帮助。
Hi just a couple of thoughts
you tried vi style commands to see
if git has reverted back to using
vi? [Esc :x]
if your commit message is small and simple, like your commit, you can use
git commit -a -m "Your message goes here"
Hope that is of some help.
这似乎是 Mac OS X 终端的问题。一些但不是全部使用 Nano 的人都遇到过这个问题。
您可以通过键入以下内容来欺骗您的终端,使其认为它是另一个终端:
...或探索终端的设置(或使用另一个终端,例如 xterm 或 iTerm)。
其他编辑器,如 Textmate、vim、BBedit,[...] 运行良好。你必须坚持使用纳米吗?
如果您的提交消息很短,您可以手动使用 -m 标志附加它:
this seems to be an issue of the Mac OS X Terminal. Some but not all people using nano encountered it.
You can trick your terminal into thinking it is another one by typing:
...or exploring the settings of your terminal (or use another one, like xterm or iTerm).
Other editors like Textmate, vim, BBedit, [...] work well. Do you have to stick with nano?
If your commit message is quite short, you can manually append it with the -m flag: