killall Xcode

Xcode doesn’t handle swapping git branches very well if you use the command line for git. My experience is that I’m often changing branches using my terminal and then I see the Xcode icon start jumping angrily in the dock, when I goto Xcode I see this prompt

Xcode prompt to reload project

Neither option does what I want

Dealing with the above is slow and results in me needing to close Xcode to reopen the project fully. To add to the annoyance I have to navigate to Xcode, dismiss the UI alert and then close because the UI alert prevents me from pressing cmd + q whilst cmd + tabing over the app.

Hacky solution

YMMV but I’ve taken to running killall Xcode as soon as I see the Xcode icon bounce in the dock. It means I don’t have to waste time navigating to Xcode to handle the UI blocking alert before quitting Xcode. Also because I’m on terminal already I’m only a few keystrokes away.