4

I've been using windows for software development. I'm not aware of MacOS internals. I'm aware that Xcode software is used to develop iOS/Mac apps but I don't need it.

For my usecase, I was able to install intellij, Java, Docker, Minikube & Visual-Studio-Code on my Intel Mac with BigSur... I'm able to run simple micro-service with working DB in local in docker container.

But when I try to use Git I'm getting this issue: xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

I think this is related to Xcode. I didn't want to touch it,
so I tried to install Git by brew.

brew install git but got error Error: git 2.29.2 is already installed

So I tried to do update brew upgrade git but again got the below error again.

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

I also tried to remove Git to do a clean install brew remove git and there was no error, but then I installed git with brew again and the same error.

Is there a way to install Git without having Xcode ? I dont want to install unnecessary software on my machine, things which I don't need.

initall
  • 2,375
  • 19
  • 27
  • This one maybe: https://sourceforge.net/projects/git-osx-installer/ Found at https://git-scm.com/download/mac – phd Jan 09 '21 at 14:20
  • tried, didn't work.... Had to install xCode command line... not sure about repercussions at this time.. but working for now... – ThrowableException Jan 09 '21 at 14:23

2 Answers2

3

What you need is not xcode but xcode command line tool which has a small download and running file space compared to xcode of 11GB download space and running space of 31GB

You can download it from apple at https://developer.apple.com/downloads/

classic-code
  • 106
  • 3
0

Note that this is a plain copy of a previous answer of mine on superuser.com.

Here's a way to install git on Mac OS X without XCode.

Git's official web site provides an installer : http://git-scm.com/download/mac

After installing git, you also have to add its directory to your path :

echo "PATH=/usr/local/git/bin:\$PATH" >> ~/.bash_profile
source ~/.bash_profile

Adding the directory to the path will prevent Mac OS X from aksing you to install XCode each time you type git in the terminal.

Credits goes to Bobby Allen and to GoZoner's answer on SO.

Daishi
  • 10,721
  • 1
  • 16
  • 20