brew 使用fatal: not in a git directory Error: Command failed with exit 128: git

foreword

Recently, I saw something new. There is an open source auto-gpt. I saw that it was written in python. When installing python, I used brew install python, and then reported an error. Considering that the small version of the system has just been updated a few days ago, is it because it has not been updated? , execute brew upgrade, and then still report an error, and it is exactly the same as the initial error

fatal: not in a git directory
Error: Command failed with exit 128: git

process

There was no problem installing the software when macos just installed brew, but I haven’t paid attention to it for a long time. The small version system has been updated for several versions. Today, it suddenly fails to install new software, including updates.

install python

Failed

 

 Then execute the update, it also fails, the error is exactly the same

 

Solution

Considering that the brew command can check the problem, brew -v

In fact, it is a git command. It is enough to configure the directory of brew. In fact, it was configured by default when brew was installed very early. However, with the update of the small version system, the git permission needs to be reconfigured. After execution, the installation is successful.

And brew -v works fine

 

 

Summarize

The brew installation actually saves a lot of time, but there are often various problems due to various reasons, and brew -v is required to follow the prompts. Linux or Unix-like systems have natural advantages for commands, but with the process of ARM CPU, especially the release of K8S, some images support x86 very well, but for ARM, only self-compilation is possible, and some compilations are still a headache.

Guess you like

Origin blog.csdn.net/fenglllle/article/details/130196389