How can I set up an editor to work with Git on Windows?

后端 未结 30 1244
悲哀的现实
悲哀的现实 2020-11-22 13:57

I\'m trying out Git on Windows. I got to the point of trying \"git commit\" and I got this error:

Terminal is dumb but no VISUAL nor

30条回答
  •  臣服心动
    2020-11-22 13:58

    This is working for me using Cygwin and TextPad 6 (EDIT: it is also working with TextPad 5 as long as you make the obvious change to the script), and presumably the model could be used for other editors as well:

    File ~/.gitconfig:

    [core]
        editor = ~/script/textpad.sh
    

    File ~/script/textpad.sh:

    #!/bin/bash
    
    APP_PATH=`cygpath "c:/program files (x86)/textpad 6/textpad.exe"`
    FILE_PATH=`cygpath -w $1`
    
    "$APP_PATH" -m "$FILE_PATH"
    

    This one-liner works as well:

    File ~/script/textpad.sh (option 2):

    "`cygpath "c:/program files (x86)/textpad 6/textpad.exe"`" -m "`cygpath -w $1`"
    

提交回复
热议问题