Linux   发布时间:2022-05-08  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了如何将gedit配置为git core.editor?大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我将gedit配置为git core.editor.
git config --global core.editor "gedit"

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

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

$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

解决方法

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

在3.x中,-s(独立)和-w(等待)可用.
这允许(如commented到Fortisimo):

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

由于Gábor Lipták评论below,这与gedit3一起使用,它与以下设备一起安装:

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

(在Linux Mint上)

大佬总结

以上是大佬教程为你收集整理的如何将gedit配置为git core.editor?全部内容,希望文章能够帮你解决如何将gedit配置为git core.editor?所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: