fatal: not in a git directory Error: Command failed with exit 128: git
brew install cmake
execute error:
Already downloaded: /Users/kingcall/Library/Caches/Homebrew/downloads/b7ef8d6eb909e967d072212c62e71bfb8e94e6227ae2d3567bbabcc561fd9fff--cmake-3.21.4.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/cmake/blobs/sha256:c86a0bb0e37c293e2d4475519d28f2784c430e871f74969a1a2afeb64b540a7d
Already downloaded: /Users/kingcall/Library/Caches/Homebrew/downloads/1e8ca69a4444469a3f380baf4e514072d4d0f0b5d5ccd43b8ce3eb68081eff3d--cmake--3.21.4.arm64_monterey.bottle.tar.gz
fatal: not in a git directory
Error: Command failed with exit 128: git
The solution is as follows:
Running brew -v will give you two prompts to set the file paths for homebrew-cask and homebrew-core to safe.directory, i.e. using the following names.
Follow the prompts
git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-core
git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-cask
Then executearch -arm64 brew install cocoapods
will be OK!
If the above error is encountered, follow the prompts
git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-services
Then execute arch -arm64 brew install cocoapods
again to succeed.
After successful execution, we execute our installation command againbrew install cmake
Read More:
- [Solved] Mac M1 Brew install Error: Command failed with exit 128:git
- How to Fix Error Cannot find command ‘git‘ – do you have ‘git‘ installed and in your PATH?
- Android Studio Warning: Process ‘command ‘git‘‘ finished with non-zero exit value 1
- Git fatal: No configured push destination. Either specify the URL from the command-line or co
- Git pull code error fatal: authentication failed fo
- HEXO D Command ERROR Deployer not found: git
- SourceTree Git Error: remote: HTTP Basic: Access denied fatal: Authentication failed
- [Solved] Git Push Error: &fatal: the remote end hung up unexpectedly
- Git pull and Git pull origin master Warning: Pulling without specifying how to reconcile divergent branches
- [Solved] Git Error: fatal: refusing to merge unrelated histories
- [Solved] Git error: bad signature 0x00000000 fatal: index file corrupt
- [Solved] Git Error: fatal: refusing to merge unrelated histories
- [Solved] MacOS terminal Run git command Error: xcrun: error: invalid active developer path
- Git: “error: RPC failed; curl 18 transfer closed with outstanding read data remaining”
- Git push error: error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)
- Git Error: failed: The TLS connection was non-properly terminated
- [Solved] Git error: refname refs/heads/master not found
- [Solved] Git Common Error: error: src refspec xxx does not match any/error: failed to push some refs to
- [Solved] git error: RPC failed; curl 56 Recv failure:Connection was resetB/s
- Git under Windows reports an error: warning: LF will be replaced by CRLF in ××××.××