问题
I'm trying to configure Git to use Adobe's Brackets as the core editor on my Windows 7 laptop. I'm using Git Bash. I have it working on a Mac at school, so I know it's possible (although after saving a file that Git opens in brackets for me to edit, I have to completely exit Brackets for it to register to Git; simply closing the file doesn't work). This is what I have configured on the Mac that works:
git config --global core.editor "open -nW -a 'Brackets’"
This is what I've tried so far on Windows:
git config --global core.editor "'c:/program files (x86)/brackets/brackets.exe' open -n -w"
with combinations of "open -n -nW -wl1 -a" as options
If I don't have Brackets already open, then this works fine- it opens Brackets and opens the file for me to edit (although again, I have to completely exit Brackets for it to register to Git as saved).
However, if I already have Brackets open, all it does it tab over to Brackets- it doesn't open up the file and it's contents at all. It doesn't matter if I have a working file open or none at all- all Git does is activate Brackets but doesn't open the file.
If anyone has any ideas how to fix this, please let me know.. it would also be nice if I could get Git to acknowledge my save by closing the edited file after saving instead of having to exit the entire program, but more than anything I just need it to open the files correctly on Windows Brackets. Thanks!
回答1:
In windows 8 powershell its Same as Mac or Linux
git config --global core.editor brackets
回答2:
This works for me on GitBash:
$ echo 'alias brackets="c:/Program\ Files\ \(x86\)/Brackets/Brackets.exe"
(You need backslash \ to escape spaces and parenthesis.)
GitBash displays no confirmation or error message for me. Close GitBash. Open GitBash. Type the following:
$ brackets
and it should open Brackets.
I found the solution on Udacity on how to set up GitBash to open the Sublime editor. https://www.udacity.com/wiki/ud775/sublime
回答3:
It will be simple In linux.
git config --global core.editor brackets
In windows test it
git config --global core.editor 'c:/program files (x86)/brackets/brackets.exe'
回答4:
git config --global core.editor "C:\Program Files (x86)\Brackets\Brackets.exe"
Windows path statements use backslashes... and quotes needed for spaces.
来源:https://stackoverflow.com/questions/23002594/how-to-configure-brackets-as-git-core-editor-in-windows