git commit sublime text 2错误 [英] git commit error with sublime text 2

查看:247
本文介绍了git commit sublime text 2错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Udacity上学习如何使用Git和GitHub课程。我正在跟着例子,但我遇到了一个问题。我一直在试图通过Google搜索和反复试验来解决这个问题大约两个小时。我认为是时候制作一个StackOverflow文章了。我更喜欢试图找出我的问题,但没有在StackOverflow上发布,但似乎在这一点上,我没有生产力,我敢肯定,这个问题是一个更有经验的开发人员的陷阱,我可以在这里发布,所以我在这里。我在不同的网站上发现了与我的类似问题的论坛帖子,并且采取了相应的措施,但无济于事。我将不胜感激任何帮助或指导。

所以,我们正在学习git和做我们的第一个git commit。我在Windows 7上。我使用Git Bash浏览计算机上的目录并执行git命令。该课程让我们使用命令将Git的默认编辑器设置为Sublime Text 2 ...

  git config --global core.editor'C:/ Program Files / Sublime Text2 / sublime_text.exe'-n -w



<现在,我使用Git Bash导航到相应的目录,然后我执行git status,并在暂存区域显示我想要的两个文件。一切都很好,很好。但是,只要我尝试做一个git提交,我得到以下错误...

 'C:/ Program Files / Sublime Text2 / sublime_text.exe'-n -w:C:/ Program Files / Sublim $ b $是Text2 / sublime_text.exe:没有这样的文件或目录
错误:编辑器出现问题'' C:/ Program Files / Sublime Text2 / subl
ime_text.exe'-n -w'。
请使用-m或-F选项提供消息。

Please help !!!



谢谢提前为你的时间和努力:)

解决方案

我也从udacity采取相同的过程,并有相同的错误。我发现.gitconfig文件中的路径在空格之前包含斜杠,但它们不是必需的。转到.gitconfig文件,你会发现你的路径为 C:/ Program Files / Sublime \\ Text \\ 2 / sublime_text.exe 。只需删除斜杠并使其成为 C:/ Program Files / Sublime Text 2 / sublime_text.exe 现在提供消息使用的错误-m将消失,崇高将在输入 git commit


时打开

I'm taking the course "How to Use Git and GitHub" on Udacity. I'm following along with the examples but I've run into a problem. I've been at it trying to fix the problem via googling and trial and error by myself for about two hours. I think it's about time to make a StackOverflow post. I prefer trying to figure out my issue without posting on StackOverflow, but it seems at this point, I'm not being productive and I'm sure this issue is a gotcha for a more experienced developer and I could save hours by posting here, so here I am. I've found forum posts on varying sites with similar issues to mine and have followed the appropriate action to no avail. I would appreciate any help or guidance.

So, we are learning about git and doing our first git commit. I'm on Windows 7. I'm using Git Bash to navigate through the directories on my computer and to do git commands. The course had us set the default editor for Git to be Sublime Text 2 with the command...

git config --global core.editor "'C:/Program Files/Sublime Text2/sublime_text.exe' -n -w"

Now, I navigate to the appropriate directory using Git Bash and then I do a git status and it shows the two files I want in the staging area. All is fine and well. But as soon as I try to do a git commit, I get the following error...

'C:/Program Files/Sublime Text2/sublime_text.exe' -n -w: C:/Program Files/Sublim
e Text2/sublime_text.exe: No such file or directory
error: There was a problem with the editor ''C:/Program Files/Sublime Text2/subl
ime_text.exe' -n -w'.
Please supply the message using either -m or -F option.

Please help!!!

Thanks in advance for your time and efforts :)

解决方案

I am also taking the same course from udacity and have the same errors . I figured out that the path in .gitconfig file includes slashes before space but they aren't needed . Go to the .gitconfig file , you will find your path as C:/Program Files/Sublime\\ Text\\ 2/sublime_text.exe . Just remove the slashes and make it C:/Program Files/Sublime Text 2/sublime_text.exe.

Now the error of providing message using -m will go away and sublime will open on entering git commit

这篇关于git commit sublime text 2错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆