简体   繁体   中英

How to configure Brackets as git core.editor in Windows

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!

在Windows 8中,它与Mac或Linux相同

git config --global core.editor brackets

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

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'
git config --global core.editor "C:\Program Files (x86)\Brackets\Brackets.exe"

Windows路径语句使用反斜杠...和空格所需的引号。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM