首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何将gedit配置为git core.editor?

如何将gedit配置为git core.editor?
EN

Stack Overflow用户
提问于 2013-10-19 01:45:02
回答 3查看 18.6K关注 0票数 24

我已经将gedit配置为git core.editor。

代码语言:javascript
复制
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不起作用):

代码语言:javascript
复制
$ 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
EN

回答 3

Stack Overflow用户

发布于 2017-01-05 01:02:09

所有的功劳都归功于VonC,但是-w使gedit (3.18)在我的ubuntu16.04上崩溃。不需要这样就能很好地工作:

代码语言:javascript
复制
git config --global core.editor "gedit -s"
票数 31
EN

Stack Overflow用户

发布于 2013-10-19 03:20:17

解决这个问题最简单的方法就是升级gedit (Ubuntu13.10的版本是3.8.3 )

在3.x中,可以使用-s (独立)和-w (等待)。

这允许(作为Fortisimocommented ):

代码语言:javascript
复制
git config --global core.editor "gedit -w -s" 

作为Gábor Lipták comments below,它适用于gedit3,它随以下文件一起安装:

代码语言:javascript
复制
sudo apt-get install gedit-common/trusty 
sudo apt-get install gedit/trusty

(在Linux Mint上)

票数 25
EN

Stack Overflow用户

发布于 2021-01-30 01:14:39

对于那些感兴趣的人:在ubuntu18下,带有-w的gedit在一个段错误下崩溃

但是使用-s是很好的

所以请这样做:

git配置--全局core.editor "gedit -s"

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19455929

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档