Skip to main content
deleted 22 characters in body
Source Link
Nimesh Neema
  • 52.9k
  • 25
  • 151
  • 212

To debug this, start by executing:

type -a git

and

echo $PATH

In OP's case, running the above commands gave the following output respectively:

git is /usr/bin/git

git is /usr/local/bin/git

git is /usr/bin/git
git is /usr/local/bin/git

and

/usr/local/opt/[email protected]/sbin

/usr/local/opt/[email protected]/bin

/Applications/MAMP/bin/php/php7.1.8/bin

/usr/bin

/bin

/usr/sbin

/sbin

/usr/local/bin

/usr/local/autoconf

/opt/X11/bin

/usr/local/share/dotnet

~/.dotnet/tools

/Library/Frameworks/Mono.framework/Versions/Current/Commands

/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin

/Applications/Android Studio.app/Contents/plugins/flutter/bin

/usr/local/opt/[email protected]/sbin
/usr/local/opt/[email protected]/bin
/Applications/MAMP/bin/php/php7.1.8/bin
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin
/usr/local/autoconf
/opt/X11/bin
/usr/local/share/dotnet
~/.dotnet/tools
/Library/Frameworks/Mono.framework/Versions/Current/Commands
/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin
/Applications/Android Studio.app/Contents/plugins/flutter/bin

(the output fromin the command lines areabove output is formatted for clarityreadability by replacing : with newline)

Now, run the following commands (using absolute path) to check if git package is actually installed:

/usr/bin/git --version

and

/usr/local/bin/git --version

The above gave the following output, respectively:

active developer path does not exist

active developer path does not exist

and

git version 2.21.0

git version 2.21.0

This indicates that Homebrew installed copy is still present in the system. However, Xcode/system installed copy (which should take precedence due to $PATH variable configuration) wasn't accessible because developer path couldn't be found.

To resolve the issue and to use the Xcode/system installed copy of git, run:

xcode-select --reset

This will resolve the error.

To use the latest version of Git, install the same via Homebrew by running:

brew install git

and set the PATH variable so that /usr/local/bin takes precedence over /usr/bin.

To debug this, start by executing:

type -a git

and

echo $PATH

In OP's case, running the above commands gave the following output respectively:

git is /usr/bin/git

git is /usr/local/bin/git

and

/usr/local/opt/[email protected]/sbin

/usr/local/opt/[email protected]/bin

/Applications/MAMP/bin/php/php7.1.8/bin

/usr/bin

/bin

/usr/sbin

/sbin

/usr/local/bin

/usr/local/autoconf

/opt/X11/bin

/usr/local/share/dotnet

~/.dotnet/tools

/Library/Frameworks/Mono.framework/Versions/Current/Commands

/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin

/Applications/Android Studio.app/Contents/plugins/flutter/bin

(the output from the command lines are formatted for clarity)

Now, run the following commands (using absolute path) to check if git package is actually installed:

/usr/bin/git --version

and

/usr/local/bin/git --version

The above gave the following output, respectively:

active developer path does not exist

and

git version 2.21.0

This indicates that Homebrew installed copy is still present in the system. However, Xcode/system installed copy (which should take precedence due to $PATH variable configuration) wasn't accessible because developer path couldn't be found.

To resolve the issue and to use the Xcode/system installed copy of git, run:

xcode-select --reset

This will resolve the error.

To use the latest version of Git, install the same via Homebrew by running:

brew install git

and set the PATH variable so that /usr/local/bin takes precedence over /usr/bin.

To debug this, start by executing:

type -a git

and

echo $PATH

In OP's case, running the above commands gave the following output respectively:

git is /usr/bin/git
git is /usr/local/bin/git

and

/usr/local/opt/[email protected]/sbin
/usr/local/opt/[email protected]/bin
/Applications/MAMP/bin/php/php7.1.8/bin
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin
/usr/local/autoconf
/opt/X11/bin
/usr/local/share/dotnet
~/.dotnet/tools
/Library/Frameworks/Mono.framework/Versions/Current/Commands
/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin
/Applications/Android Studio.app/Contents/plugins/flutter/bin

(in the above output is formatted for readability by replacing : with newline)

Now, run the following commands (using absolute path) to check if git package is actually installed:

/usr/bin/git --version

and

/usr/local/bin/git --version

The above gave the following output, respectively:

active developer path does not exist

and

git version 2.21.0

This indicates that Homebrew installed copy is still present in the system. However, Xcode/system installed copy (which should take precedence due to $PATH variable configuration) wasn't accessible because developer path couldn't be found.

To resolve the issue and to use the Xcode/system installed copy of git, run:

xcode-select --reset

This will resolve the error.

To use the latest version of Git, install the same via Homebrew by running:

brew install git

and set the PATH variable so that /usr/local/bin takes precedence over /usr/bin.

added 23 characters in body
Source Link
Nimesh Neema
  • 52.9k
  • 25
  • 151
  • 212

To debug this, start by executing:

type -a git

followed byand

echo $PATH

In OP's case, running the above commands gave the following output respectively:

git is /usr/bin/git

git is /usr/local/bin/git

and

/usr/local/opt/[email protected]/sbin

/usr/local/opt/[email protected]/bin

/Applications/MAMP/bin/php/php7.1.8/bin

/usr/bin

/bin

/usr/sbin

/sbin

/usr/local/bin

/usr/local/autoconf

/opt/X11/bin

/usr/local/share/dotnet

~/.dotnet/tools

/Library/Frameworks/Mono.framework/Versions/Current/Commands

/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin

/Applications/Android Studio.app/Contents/plugins/flutter/bin

(formattingthe output from the command lines are formatted for simplified readingclarity)

Now, runningrun the following commands (using absolute path) to check if git package is actually installed:

/usr/bin/git --version

and

/usr/local/bin/git --version

The above gave the following output, respectively:

active developer path does not exist

and

git version 2.21.0

indicatingThis indicates that while Homebrew installed copy is still present within the current latest versionsystem. However, Xcode/system installed copy which(which should take precedence due to $PATH variable configuration) wasn't accessible because developer path couldn't be found.

To resolve the issue and to use the Xcode/system installed copy of git, run:

xcode-select --reset

This will resolve the error.

To use the latest version of Git, install the same via Homebrew by running:

brew install git

and set the PATH variable so that /usr/local/bin takes preferenceprecedence over /usr/bin.

To debug this, start by executing:

type -a git

followed by

echo $PATH

In OP's case, running the above commands gave the following output respectively:

git is /usr/bin/git

git is /usr/local/bin/git

and

/usr/local/opt/[email protected]/sbin

/usr/local/opt/[email protected]/bin

/Applications/MAMP/bin/php/php7.1.8/bin

/usr/bin

/bin

/usr/sbin

/sbin

/usr/local/bin

/usr/local/autoconf

/opt/X11/bin

/usr/local/share/dotnet

~/.dotnet/tools

/Library/Frameworks/Mono.framework/Versions/Current/Commands

/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin

/Applications/Android Studio.app/Contents/plugins/flutter/bin

(formatting for simplified reading)

Now, running the following commands (using absolute path) to check if git package is actually installed:

/usr/bin/git --version

and

/usr/local/bin/git --version

gave the following, respectively:

active developer path does not exist

and

git version 2.21.0

indicating that while Homebrew installed copy is still present with the current latest version. However, Xcode/system installed copy which should take precedence due to $PATH variable configuration wasn't accessible because developer path couldn't be found.

To resolve the issue and use the Xcode/system installed copy, run:

xcode-select --reset

This will resolve the error.

To use the latest version of Git, install the same via Homebrew by running:

brew install git

and set the PATH variable so that /usr/local/bin takes preference over /usr/bin.

To debug this, start by executing:

type -a git

and

echo $PATH

In OP's case, running the above commands gave the following output respectively:

git is /usr/bin/git

git is /usr/local/bin/git

and

/usr/local/opt/[email protected]/sbin

/usr/local/opt/[email protected]/bin

/Applications/MAMP/bin/php/php7.1.8/bin

/usr/bin

/bin

/usr/sbin

/sbin

/usr/local/bin

/usr/local/autoconf

/opt/X11/bin

/usr/local/share/dotnet

~/.dotnet/tools

/Library/Frameworks/Mono.framework/Versions/Current/Commands

/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin

/Applications/Android Studio.app/Contents/plugins/flutter/bin

(the output from the command lines are formatted for clarity)

Now, run the following commands (using absolute path) to check if git package is actually installed:

/usr/bin/git --version

and

/usr/local/bin/git --version

The above gave the following output, respectively:

active developer path does not exist

and

git version 2.21.0

This indicates that Homebrew installed copy is still present in the system. However, Xcode/system installed copy (which should take precedence due to $PATH variable configuration) wasn't accessible because developer path couldn't be found.

To resolve the issue and to use the Xcode/system installed copy of git, run:

xcode-select --reset

This will resolve the error.

To use the latest version of Git, install the same via Homebrew by running:

brew install git

and set the PATH variable so that /usr/local/bin takes precedence over /usr/bin.

Source Link
Nimesh Neema
  • 52.9k
  • 25
  • 151
  • 212

To debug this, start by executing:

type -a git

followed by

echo $PATH

In OP's case, running the above commands gave the following output respectively:

git is /usr/bin/git

git is /usr/local/bin/git

and

/usr/local/opt/[email protected]/sbin

/usr/local/opt/[email protected]/bin

/Applications/MAMP/bin/php/php7.1.8/bin

/usr/bin

/bin

/usr/sbin

/sbin

/usr/local/bin

/usr/local/autoconf

/opt/X11/bin

/usr/local/share/dotnet

~/.dotnet/tools

/Library/Frameworks/Mono.framework/Versions/Current/Commands

/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin

/Applications/Android Studio.app/Contents/plugins/flutter/bin

(formatting for simplified reading)

Now, running the following commands (using absolute path) to check if git package is actually installed:

/usr/bin/git --version

and

/usr/local/bin/git --version

gave the following, respectively:

active developer path does not exist

and

git version 2.21.0

indicating that while Homebrew installed copy is still present with the current latest version. However, Xcode/system installed copy which should take precedence due to $PATH variable configuration wasn't accessible because developer path couldn't be found.

To resolve the issue and use the Xcode/system installed copy, run:

xcode-select --reset

This will resolve the error.

To use the latest version of Git, install the same via Homebrew by running:

brew install git

and set the PATH variable so that /usr/local/bin takes preference over /usr/bin.