2013-10-18 7 views
15

Ich habe gedit als git core.editor konfiguriert.Wie konfiguriere ich gedit als git core.editor?

git config --global core.editor "gedit" 

Dies funktioniert gut, es sei denn, es gibt bereits ein gedit Windows geöffnet. In diesem Fall wird COMMIT_EDITMSG im vorhandenen Fenster geöffnet und gedit kehrt sofort zurück. Git endet mit einer leeren Commit-Nachricht und schlägt fehl.

Diese Seite (http://fabianschuiki.wordpress.com/2012/05/20/use-gedit-as-git-editor/) schlägt vor, "gedit -s -w" verwenden, aber ich habe nicht diese Optionen (und --new-Fenster nicht funktioniert):

$ 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 

Antwort

16

Der einfachste Weg

In 3.x zu lösen diese gedit zu aktualisieren wäre

(was bei 3.8.3 mit einem Ubuntu 13.10 ist), -s (Standalone) und -w (wait) zur Verfügung.
das für (wie commented von Fortisimo) erlaubt:

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

Als Gábor Lipták Kommentare below funktioniert dies mit gedit3, die mit installiert ist:

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

(auf Linux Mint)

+1

'' 'git config---global core.editor "gedit -w es"' '' – Fortisimo

+0

@Fortisimo guten Punkt. Ich habe Ihren Kommentar in die Antwort für mehr Sichtbarkeit aufgenommen. – VonC

+0

Um gedit 3 für linux mint zu installieren: sudo apt-get installieren gedit-common/trusty sudo apt-get installieren gedit/trusty –

13

Alle Kredite an VonC Antwort, aber die -w macht gedit (3.18) Absturz auf meinem Ubuntu 16.04. Adaequat ohne aber:

git config --global core.editor "gedit -s" 
+0

Interessant zu wissen. +1 – VonC

+0

Es stürzt nur ab, wenn Sie -w und -s kombinieren. Sowohl -w als auch -s funktionieren unabhängig voneinander. Aber es scheint, dass -s impliziert -w ... – Superole

Verwandte Themen