I am trying to set the text editor that will open when Git needs me to type something (e.g., message for a commit).
I am on Mac OSX 10.9.5 and using bash. I have configured the default editor to TextEdit - my .gitconfig file looks like this:
[user]
name = My Name
email = [email protected]
[core]
autocrlf = input
safecrlf = true
editor = /Applications/TextEdit.app
However, Git will not allow me to open TextEdit:
MyMac:aDir user$ git commit
fatal: cannot exec '/Applications/TextEdit.app': Permission denied
error: unable to start editor '/Applications/TextEdit.app'
Please supply the message using either -m or -F option.
I also tried to move TextEdit into my user directory, but I can only move an alias (I think it's just a pointer to the original TextEdit location). So, I get the same result. But, it's just a problem with Git, because this works:
MyMac:aDir user$ open ~/Applications/TextEdit
How can I get Git to let the user (the ONLY user on this computer) open TextEdit?
editor = open -W -n in your .gitconfigAssuming Textedit is your default editor on Mac you need to specify open -W -n against editor in your .gitconfig
While doing git commit, the file will automatically open in Textedit
[user]
name = My Name
email = [email protected]
[core]
autocrlf = input
safecrlf = true
editor = open -W -n
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With