我有gedit配置为git core.editor.
git config --global core.editor "gedit"
Run Code Online (Sandbox Code Playgroud)
除非已打开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
Run Code Online (Sandbox Code Playgroud)
Von*_*onC 22
解决这个问题的最简单方法是升级gedit
(使用Ubuntu 13.10时为3.8.3)
在3.x中,-s
(独立)和-w
(等待)可用.
这允许(如评论由Fortisimo):
git config --global core.editor "gedit -w -s"
Run Code Online (Sandbox Code Playgroud)
作为GABORLipták评论下方,这一点也适用gedit3,它安装有:
sudo apt-get install gedit-common/trusty
sudo apt-get install gedit/trusty
Run Code Online (Sandbox Code Playgroud)
(在Linux Mint上)
Arn*_*d P 20
所有归功于VonC的回答,但是-w
make gedit(3.18)在我的ubuntu 16.04上崩溃了.尽管如此工作正常:
git config --global core.editor "gedit -s"
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
13506 次 |
最近记录: |