Git 使用 Sublime Text 为默认编辑器
2015-09-06 11:29
791 查看
Git 使用 Sublime Text 为默认编辑器
首先, 我的 sublime text 的完整路径为:F:\Program Files\Sublime Text 3\sublime text.exe
(注意
sublime text.exe名字中没有下划线)
接下来是步骤:
1. 将
F:\Program Files\Sublime Text 3\添加到 环境变量 中;(之后可能需要重启电脑使更改生效)
2. 打开 git,设置 sublime text 为默认的编辑器, 使用如下命令:
git config
--global core.editor “‘sublime text.exe’ -w”
此处注意:
如果路径中有空格, 需要用 单引号 括起来, 如上面的
'sublime text.exe';
-w 表示 ask git to wait for you to finish typing the message in the text editor
参考资料: 让 EmEditor 成为 Git 的编辑器 看第三楼的回答
3. 验证有没有效果:
git commit -a, 之后 sublime text 会被打开,
同时一个名为
COMMIT_EDITMSG文件也会被打开, 嗯, 就是如此。
4. 但输出完成后必须关闭 sublime text,否则 Git 无法完成提交。
参考资料
让 EmEditor 成为 Git 的编辑器Git使用sublime_text作用默认编辑器
CMD命令行中,文件名有空格怎么输入?
如何在命令行运行程序?看 26 楼
使用git管理源码之修改默认编辑器
补充
做过如下尝试:1.
git config --global core.editor "sublime text.exe"(失败)
2.
git config --global core.editor "F:/Program Files/Sublime Text 3/sublime text.exe"(失败)
3.
git config --global core.editor "'F:/Program Files/Sublime Text 3/sublime text.exe' -w"(失败)
4.
git config --global core.editor "'sublime text.exe' -w"(成功)
相关文章推荐
- RPC failed; result=22, HTTP code = 411
- git更新已經刪除的文件
- 提取Git每次提交后Commit的文件
- GIT迁移服务器
- 分布式版本管理git入门指南使用资料汇总及文章推荐
- 一步一步跟我学易语言之第二个易程序菜单设计
- FCK编辑器(FCKEditor)添加新按钮和功能的修改方法
- ecshop后台编辑器替换成ueditor编辑器
- 10个基于jQuery或JavaScript的WYSIWYG 编辑器整理
- PHP网页 Ewebeditor 编辑器嵌入方法
- kindSoft在线网页编辑器简单的配置参数介绍
- dedecms5.5 最新版ckeditor编辑器整合教程
- javascript 在线文本编辑器实现代码
- 在线编辑器中换行与内容自动提取
- 网页上的Javascript编辑器和代码格式化
- Git远程操作详解
- SublimeText编译C开发环境设置
- 25个 Git 进阶技巧(翻译)
- 详解版本控制利器Git,SVN的异同以及适用范围
- 推荐5款跨平台的PHP编辑器