我已经将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",但我没有这些选项(而且--new-window不起作用):
$ 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发布于 2017-01-05 01:02:09
所有的功劳都归功于VonC,但是-w使gedit (3.18)在我的ubuntu16.04上崩溃。不需要这样就能很好地工作:
git config --global core.editor "gedit -s"发布于 2013-10-19 03:20:17
解决这个问题最简单的方法就是升级gedit (Ubuntu13.10的版本是3.8.3 )
在3.x中,可以使用-s (独立)和-w (等待)。
git config --global core.editor "gedit -w -s" 作为Gábor Lipták comments below,它适用于gedit3,它随以下文件一起安装:
sudo apt-get install gedit-common/trusty
sudo apt-get install gedit/trusty(在Linux Mint上)
发布于 2021-01-30 01:14:39
对于那些感兴趣的人:在ubuntu18下,带有-w的gedit在一个段错误下崩溃

但是使用-s是很好的
所以请这样做:
git配置--全局core.editor "gedit -s"
https://stackoverflow.com/questions/19455929
复制相似问题