如何将gedit配置为git core.editor? [英] How to configure gedit as git core.editor?

查看:126
本文介绍了如何将gedit配置为git core.editor?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将gedit配置为git core.editor。

  git config --global core.editorgedit

这可以正常工作,除非已经有gedit窗口打开。在这种情况下,COMMIT_EDITMSG在现有窗口中打开,gedit立即返回。 Git以空的提交信息结束,并失败。



这个网站( http://fabianschuiki.wordpress.com/2012/05/20/use-gedit-as-git-editor/ )建议使用gedit -s - w,但我没有这些选项(和 - 新窗口不起作用):
$ b $

  $ gedit -V 
gedit - 版本2.28.4

$ gedit - 帮助
用法:
gedit [选项...] [文件...] - 编辑文本文件

帮助选项:
-h,--help显示帮助选项
--help-all显示所有帮助选项
--help-gtk显示GTK +选项
--help-sm-client显示会话管理选项

应用程序选项:
-V,--version显示应用程序的版本
--encoding = ENCODING设置字符编码用于打开命令行
--l中列出的文件ist-encodings显示编码选项的可能值列表
--new-window在现有的gedit实例中创建新的顶层窗口
--new-document在现有的实例中创建一个新文档gedit
--display = DISPLAY X display使用


解决方案

解决这个问题的最简单的方法是升级 gedit (在Ubuntu 13.10中为3.8.3)



在3.x中, -s (独立)和 -w (等待)都可用。
允许(如评论通过 Fortisimo ):

  git config --global core.editorgedit -w -s

GolborLipták

<$> p $ p> sudo apt-get install gedit-common / trusty
sudo apt-get install gedit / trusty

(在Linux Mint上)


I have gedit configured as git core.editor.

git config --global core.editor "gedit"

This works fine unless there is already a gedit windows open. In that case, COMMIT_EDITMSG is opened in the existing window and gedit returns immediately. Git ends up with an empty commit message and fails.

This site (http://fabianschuiki.wordpress.com/2012/05/20/use-gedit-as-git-editor/) suggests using "gedit -s -w", but I don't have those options (and --new-window doesn't work):

$ gedit -V
gedit - Version 2.28.4

$ gedit --help
Usage:
  gedit [OPTION...] [FILE...] - Edit text files

Help Options:
  -h, --help                      Show help options
  --help-all                      Show all help options
  --help-gtk                      Show GTK+ Options
  --help-sm-client                Show session management options

Application Options:
  -V, --version                   Show the application's version
  --encoding=ENCODING             Set the character encoding to be used to open the files listed on the command line
  --list-encodings                Display list of possible values for the encoding option
  --new-window                    Create a new toplevel window in an existing instance of gedit
  --new-document                  Create a new document in an existing instance of gedit
  --display=DISPLAY               X display to use

解决方案

The simplest way to solve this would be to upgrade gedit (which is at 3.8.3 with an Ubuntu 13.10)

In 3.x, -s (standalone) and -w (wait) are available.
That allows for (as commented by Fortisimo):

git config --global core.editor "gedit -w -s" 

As Gábor Lipták comments below, this works with gedit3, which is installed with:

sudo apt-get install gedit-common/trusty 
sudo apt-get install gedit/trusty

(on Linux Mint)

这篇关于如何将gedit配置为git core.editor?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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