Nano使用Git提交对kb命令无响应
在启动git提交命令时,Ubuntu 12.04上的Nano出现问题。当我启动提交(例如git commit-a-m“some text”)时,它会显示Nano,它对任何kb命令(包括底部菜单上的ctrl-命令)都完全没有响应 以下是从Nano显示的内容:Nano使用Git提交对kb命令无响应,git,nano,Git,Nano,在启动git提交命令时,Ubuntu 12.04上的Nano出现问题。当我启动提交(例如git commit-a-m“some text”)时,它会显示Nano,它对任何kb命令(包括底部菜单上的ctrl-命令)都完全没有响应 以下是从Nano显示的内容: # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message abort
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# Committer: root <root@user-Ubuntu.(none)>
#
# On branch master
#
# Initial commit
#
# Changes to be committed:
# (use "git rm --cached <file>..." to unstage)
#
# new file: controller/ContactsController.php
# new file: index.php
# new file: model/ContactsGateway.php
# new file: model/ContactsService.php
# new file: model/ValidationException.php
# new file: view/contact-form.php
# new file: view/contact.php
# new file: view/contacts.php
# new file: view/error.php
#
#请输入更改的提交消息。起跑线
#将忽略带有“#”的消息,空消息将中止提交。
#
#提交人:root
#
#论分行行长
#
#初始提交
#
#要提交的更改:
#(使用“git rm--cached…”取消存储)
#
#新文件:controller/ContactsController.php
#新文件:index.php
#新文件:model/ContactsGateway.php
#新文件:model/ContactsService.php
#新文件:model/ValidationException.php
#新文件:view/contact-form.php
#新文件:view/contact.php
#新文件:view/contacts.php
#新文件:view/error.php
#
任何帮助都将不胜感激
谢谢 每当我看到有人以
root
身份向Git提交文件时,我都会感到不安
话虽如此,试着从图片中取出gksu
,直接使用sudo
:
sudo git commit -a -m "sample text"
使用Git的
-m
选项时,不应触发$EDITOR
,因为您在命令行上提供提交消息。你确定你在使用这个选项吗?我的想法是准确的,确切的命令是——“gksu git commit-a-m”示例文本”和Nano弹出,完全冻结。我总是不安地看到人们以root
身份提交。话虽如此,如果你先su
到root
然后运行git commit-a-m”示例文本“
,有效吗?我是Ubuntu新手,所以如果不是从root提交,最好的做法是什么?对于您的查询,由于没有gksu的权限,我无法提交。我已经说过,在我按上述方式运行命令后,我输入了密码,然后Nano加载,但完全没有响应,从而导致我关闭终端窗口。如果存储库位于您的主目录中(非常常见),您应该可以作为您的用户提交。如果它位于类似于/var/www/html
的位置,我建议您移动到您的主目录,或者允许用户在该目录上进行写操作。如果使用sudogitcommit-a-m“示例文本”
,而不是使用gksu
,会发生什么?这是一个基于终端的命令,其作用应与gksu
命令相同。