git commit -a / 纳米

发布于 2024-10-10 17:44:58 字数 1307 浏览 0 评论 0原文

由于某种原因,当我尝试运行 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

澉约 2024-10-17 17:44:58

你好,只是一些想法,

  1. 你确定你在纳米吗?有
    你尝试了 vi 风格的命令来查看
    如果 git 已恢复使用
    六? [Esc :x]
  2. 如果您的提交消息小而简单,就像您的提交一样,您可以使用

    git commit -a -m "你的消息在这里"

希望是这样的一些帮助。

Hi just a couple of thoughts

  1. Are you sure you are in nano? have
    you tried vi style commands to see
    if git has reverted back to using
    vi? [Esc :x]
  2. 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.

り繁华旳梦境 2024-10-17 17:44:58

这似乎是 Mac OS X 终端的问题。一些但不是全部使用 Nano 的人都遇到过这个问题。

您可以通过键入以下内容来欺骗您的终端,使其认为它是另一个终端:

TERM=VT100
export TERM 

...或探索终端的设置(或使用另一个终端,例如 xterm 或 iTerm)。

其他编辑器,如 Textmate、vim、BBedit,[...] 运行良好。你必须坚持使用纳米吗?

如果您的提交消息很短,您可以手动使用 -m 标志附加它:

git commit -am "my commit message."

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:

TERM=VT100
export TERM 

...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:

git commit -am "my commit message."
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文