使用 GIT 提交时我的命令行被锁定

发布于 2024-12-19 13:53:31 字数 269 浏览 3 评论 0原文

学习 GIT。我尝试提交一组文件,下面您可以看到我到达的位置。

请求提交评论/消息,但一旦我到达此屏幕,我无法输入任何文本,我尝试的所有操作,一旦到达此屏幕,它就不会让我在窗口中输入任何文本。

我正在使用 msysGit 版本和一个名为 Console 2 的程序,该程序只是一个包含 msysGit 命令行工具的包装器

任何想法为什么它会这样做

“屏幕截图”

Learning GIT. I tried committing a group of files, below you can see where I got to.

Asking for the commit comment/message but once I get to this screen, I am not able to input any text, everything I try, it will not let me enter any text into the window once it gets to this screen.

I am using the msysGit version with a program called Console 2 which is just a wrapper holding the msysGit command line tool

Any ideas why it would do this

Screenshot

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(3

怀中猫帐中妖 2024-12-26 13:53:31

Git 默认使用“Vi”文本编辑器。您需要将其添加到您的 Git 配置文件中:

nano ~/.gitconfig

如果您还没有该文件,则该文件可能为空。添加此行,然后使用 Ctrl-X 保存:

git config core.editor "nano"

Nano 是一个更容易使用的文本编辑器,可以满足您的需要。

如果您的平台上没有安装 nano(如 Windows 7 标准安装中的情况),您可以选择使用 Notepad++,或尝试 此安装程序改为使用标准记事本。

Git is using the "Vi" text editor by default. You need to add this to your Git config file:

nano ~/.gitconfig

This file may be blank if you do not have one yet. Add this line and then save using Ctrl-X:

git config core.editor "nano"

Nano is a more straightforward to use text editor for what you want to do.

If you don't have nano installed on your platform (as is the case in standard installs of Windows 7), you can optionally use Notepad++, or try this setup program to use standard Notepad instead.

绳情 2024-12-26 13:53:31

在调用 git 之前尝试将 EDITOR 设置为您习惯的内容(或使用 git config 设置 core.editor)。或者学习使用 vi

或者,从命令行提供消息

git commit -m 'this is the commit message'

Try setting EDITOR to something you're used to before invoking git (or use git config to set core.editor). Or learn to use vi.

Alternatively, provide message from the command line

git commit -m 'this is the commit message'
绝不放开 2024-12-26 13:53:31

您看到的是 git 打开 vim 供您编辑提交。

如果您更喜欢其他编辑器,您可以通过设置更改编辑器:

export VISUAL=<your-editor>
export EDITOR=<your-editor>

您在该屏幕中所需要做的就是键入提交注释并保存它,它将继续提交(无论它出现在哪个编辑器中)。

What you see is git opening vim for you to edit the commit.

If you prefer other editor you can change the editor by setting:

export VISUAL=<your-editor>
export EDITOR=<your-editor>

All you need to do in that screen is to type a commit comment and save it, it will proceed with the commit (in whichever editor it appears).

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