Mojave broke git

GeoffWillis

macrumors newbie
Original poster
Mar 11, 2012
28
1
San Antonio, TX
I use my Mac for S/W development and use git as my version control tool. I have never wanted/needed X-code in the past so never installed it. I recently upgraded to Mojave and noticed my git no longer works. The error "missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun" appears, and is easily googled with a recommendation of running "xcode-select --install". When I do that, I get the pop-up offering to install the command line tools with options: get Xcode, Not now, and install. I choose install and then get the "Can't install the software because it is not currently available from the Software Update Server". Once again something easily googled. Unfortunately it seems all the recommendations center around installing Xcode which I really don't want to do. Is there a solution to this that doesn't involve loading the entire Xcode application? I'm ok with just the CLI, but would like to avoid Xcode if possible. Appreciate any suggestions.
 
  • Like
Reactions: allenjom2

Senor Cuete

macrumors 6502
Nov 9, 2011
273
12
...Unfortunately it seems all the recommendations center around installing Xcode which I really don't want to do....
Why not? It's free. Do you develop Mac "S/W" that doesn't require resources like images and .xib files? A full-featured Mac Application requires a lot of things like code signing and sandboxing that are handled automatically by XCode. Do you use Cocoa?
 

chrfr

macrumors G3
Jul 11, 2009
8,181
2,513
Why not? It's free. Do you develop Mac "S/W" that doesn't require resources like images and .xib files? A full-featured Mac Application requires a lot of things like code signing and sandboxing that are handled automatically by XCode. Do you use Cocoa?
Xcode uses a lot of disk space. There's no sense in installing it if one doesn't need the rest of the features.
 

Senor Cuete

macrumors 6502
Nov 9, 2011
273
12
On my iMac the complete installation of XCode 10.1 requires 7.19 GB. A typical hard drive today is at least a terabyte. This means that it uses about .7% of a terabyte hard drive.

You didn't answer the question: What "s/w" do you develop that doesn't use any of the features of XCode - like a resource editor/compiler, debugger, etc.?
 

chrfr

macrumors G3
Jul 11, 2009
8,181
2,513
On my iMac the complete installation of XCode 10.1 requires 7.19 GB. A typical hard drive today is at least a terabyte. This means that it uses about .7% of a terabyte hard drive.

You didn't answer the question: What "s/w" do you develop that doesn't use any of the features of XCode - like a resource editor/compiler, debugger, etc.?
I'm not the person who asked the original question. Apple sells a lot of computers with expensive SSDs in them and 1TB of storage isn't that common in Mac portables. Xcode is complete overkill to write and compile command line binaries, for instance. What the OP is doing doesn't really matter; I'm sure they know what they need. I'm not sure why that matters to you.
 
  • Like
Reactions: smirking

chown33

Moderator
Staff member
Aug 9, 2009
8,356
4,334
Gourd City
I use my Mac for S/W development and use git as my version control tool. I have never wanted/needed X-code in the past so never installed it. I recently upgraded to Mojave and noticed my git no longer works. The error "missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun" appears, and is easily googled with a recommendation of running "xcode-select --install". When I do that, I get the pop-up offering to install the command line tools with options: get Xcode, Not now, and install. I choose install and then get the "Can't install the software because it is not currently available from the Software Update Server". Once again something easily googled. Unfortunately it seems all the recommendations center around installing Xcode which I really don't want to do. Is there a solution to this that doesn't involve loading the entire Xcode application? I'm ok with just the CLI, but would like to avoid Xcode if possible. Appreciate any suggestions.
Which git is actually running when you run git? If you're using shell cmds, enter type git or which git in the shell to have it tell you the git it's running.

If you're running git from somewhere other than a shell, please tell us how you're running it.

When you used git before, where was it running from? Is that the same as the output of which git?


The reason I've asked those questions is because Mojave may have done a few different things to break git. It may also have done something I haven't listed.

First, Mojave may have put a 'git' command into a dir in the PATH that's earlier in the search order than where you placed your git.

Second, it may have added a dir to the PATH that results in a different git than the one you were using before. This is effectively the same as the "First" possibility immediately above, but there are two distinct possible causes.

Third, Mojave could have installed some system libraries or frameworks that are no longer compatible with your original git, so even though your original git is being found and run, its reliance on a lib or framework has been damaged.

Finally, what happens if you change your PATH so your original git gets found and run before whatever git Mojave is running by default?
 
  • Like
Reactions: GeoffWillis

GeoffWillis

macrumors newbie
Original poster
Mar 11, 2012
28
1
San Antonio, TX
Which git is actually running when you run git? If you're using shell cmds, enter type git or which git in the shell to have it tell you the git it's running.

If you're running git from somewhere other than a shell, please tell us how you're running it.

When you used git before, where was it running from? Is that the same as the output of which git?


The reason I've asked those questions is because Mojave may have done a few different things to break git. It may also have done something I haven't listed.

First, Mojave may have put a 'git' command into a dir in the PATH that's earlier in the search order than where you placed your git.

Second, it may have added a dir to the PATH that results in a different git than the one you were using before. This is effectively the same as the "First" possibility immediately above, but there are two distinct possible causes.

Third, Mojave could have installed some system libraries or frameworks that are no longer compatible with your original git, so even though your original git is being found and run, its reliance on a lib or framework has been damaged.

Finally, what happens if you change your PATH so your original git gets found and run before whatever git Mojave is running by default?
Why not? It's free. Do you develop Mac "S/W" that doesn't require resources like images and .xib files? A full-featured Mac Application requires a lot of things like code signing and sandboxing that are handled automatically by XCode. Do you use Cocoa?
I was trying to avoid arguments as to the utility of XCode, simply my choice. I use Netbeans, Vis Code, Eclipse, etc and don't want/need the bloat associated with XCode. My code is not mac specific and must run on any box.
 

Red Menace

macrumors 6502
May 29, 2011
380
45
Littleton, Colorado, USA
I hear that. I've got Xcode for the occasional project I may want to look at, but it is a beast that I would prefer not to mess with if at all possible. The command line tools are the best parts, and 190MB vs 13.5GB is pretty much a no-brainer.
 
  • Like
Reactions: GeoffWillis

GeoffWillis

macrumors newbie
Original poster
Mar 11, 2012
28
1
San Antonio, TX
Which git is actually running when you run git? If you're using shell cmds, enter type git or which git in the shell to have it tell you the git it's running.

If you're running git from somewhere other than a shell, please tell us how you're running it.

When you used git before, where was it running from? Is that the same as the output of which git?


The reason I've asked those questions is because Mojave may have done a few different things to break git. It may also have done something I haven't listed.

First, Mojave may have put a 'git' command into a dir in the PATH that's earlier in the search order than where you placed your git.

Second, it may have added a dir to the PATH that results in a different git than the one you were using before. This is effectively the same as the "First" possibility immediately above, but there are two distinct possible causes.

Third, Mojave could have installed some system libraries or frameworks that are no longer compatible with your original git, so even though your original git is being found and run, its reliance on a lib or framework has been damaged.

Finally, what happens if you change your PATH so your original git gets found and run before whatever git Mojave is running by default?
  1. I run git from the command line (vi is my favorite editor...). A "which git" shows usr/bin which is in my PATH right after current dir ("."), i.e. (.:/usr/local/bin:yada yada yada) in my .bash_profile.
  2. There is an Anaconda dir in my path following the /usr/bin which could be issue #2 you mentioned above, but all worked fine before Mojave.
  3. Your #3 above has me trying to remember if I even installed git on this box, or it came loaded, I just don't remember, but the dates on most of usr/bin dir indicate it came pre-loaded.
  4. Not sure I follow your #4, since /usr/bin is the second thing in my PATH (echo $PATH), and which git shows /usr/bin I'd think that resolves correctly. I did try executing using full path i.e. /usr/bin/git update but no joy.
I've got a lot of changes to my baseline that i want to commit, but not able to. I'm having to save files and diff them now, but that's sustainable!
[doublepost=1541536053][/doublepost]
I hear that. I've got Xcode for the occasional project I may want to look at, but it is a beast that I would prefer not to mess with if at all possible. The command line tools are the best parts, and 190MB vs 13.5GB is pretty much a no-brainer.
Thanks, you put that much better than I. I simply don't want to use it, nor defend my decision not to.
[doublepost=1541537739][/doublepost]
Indeed, the Mojave Xcode Command Line tools are now here: (login required) Command Line Tools (macOS 10.14) for Xcode 10.1.dmg
This solved the problem. Not sure why I had to install 970MB of CLI to get git to work, but this did the trick. Thanks to all who weighed in. Off to go commit my work before I loose it!
 
Last edited:

556fmjoe

macrumors 68000
Apr 19, 2014
1,604
902
I hear that. I've got Xcode for the occasional project I may want to look at, but it is a beast that I would prefer not to mess with if at all possible. The command line tools are the best parts, and 190MB vs 13.5GB is pretty much a no-brainer.
I agree with this. Xcode is my least favorite part of macOS. Even the command line tools are large when all I need is git, make, and a compiler.
 

chrfr

macrumors G3
Jul 11, 2009
8,181
2,513
Hi

For me git is moved from /usr/bin/git to /usr/local/bin/git
You must have installed a copy of git using something other than Apple's developer tools installers. Apple puts it in /usr/bin/git, even on Mojave.