添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers. Visit Stack Exchange

Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.

Sign up to join this community

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

My current git config core.editor returns dreamweaver which I set up two years ago from inside the app(IIRC), and now I don't use it. I am receiving error while amending the author of the last commit.

~$ git commit --amend --author="me <my@mail>"
hint: Waiting for your editor to close the file... fatal: cannot run 
dreamweaver: No such file or directory
error: unable to start editor 'dreamweaver'

How do I set it to use Xcode? I tried

git config --global core.editor="xcode"
error: invalid key: core.editor=Xcode

And from https://stackoverflow.com/questions/53550025/git-unable-to-start-xcode-from-terminal-on-mac-os-x, even though xed launches Xcode.

$ git config --global core.editor="xed"
error: invalid key: core.editor=xed

xed -w also launches Xcode so I tried the same instead of ="xed -w" but same error.

@ankiiiiiii Not sure whether you really want to wait for Xcode to launch every time you commit something. – nohillside Aug 25, 2019 at 9:45 it would mostly be open. But seems like a trouble. Should I set it to a light weight editor? – anki Aug 25, 2019 at 9:46 @ankiiiiiii Well, I have set it to open a new buffer within (an already running) Emacs. Otherwise I would probably just use vi or nano – nohillside Aug 25, 2019 at 9:48 If you primarily work with Xcode what's the harm in doing this? It will always be open and you get to use the editor and shortcuts you're most familiar with rather than get stuck trying to close vim. – Declan McKenna May 12, 2020 at 10:56

I would never want to do what you want, I think it's a horrible idea, but I tried to, and I succeeded!

What did I do? Easy:

  • Open Xcode and remove the splash window from the boot (in case it could create some mayhem).

  • Find Xcode: well, it's hard to explain how, but I found it at /Applications/Xcode.app/Contents/MacOS/Xcode.

  • Repeat your mistake:

    $ git config core.editor=/Applications/Xcode.app/Contents/MacOS/Xcode 
    error: invalid key: core.editor=/Applications/Xcode.app/Contents/MacOS/Xcode
    
  • Make it right:

    $ git config core.editor /Applications/Xcode.app/Contents/MacOS/Xcode 
    $ echo $?
    
  • Cloned a repo, made a silly change, added it to the index.

  • git commit, tada!

  •