首页 > 其他分享 >[Brew]brew update命令:Warning: No remote 'origin' in /opt/homebrew/Library/Taps/homebrew/hom

[Brew]brew update命令:Warning: No remote 'origin' in /opt/homebrew/Library/Taps/homebrew/hom

时间:2023-01-22 22:23:12浏览次数:77  
标签:origin git remote update services homebrew

最近在使用Brew的时候,遇到了:

 ****** Second, We should find the update. [brew update] ****** 
fatal: not in a git directory
Warning: No remote 'origin' in /opt/homebrew/Library/Taps/homebrew/homebrew-services, skipping update!
Already up-to-date.

很受启发的是这条comment:

在homebrew-core目录下,执行了git remote -v:

mokin.li@MoKinLiMacBook-Pro homebrew-core % git remote -v
origin	https://github.com/Homebrew/homebrew-core (fetch)
origin	https://github.com/Homebrew/homebrew-core (push)

然后去homebrew-services目录下执行:

mokin.li@MoKinLiMacBook-Pro homebrew % cd homebrew-services 
mokin.li@MoKinLiMacBook-Pro homebrew-services % git remote -v       
fatal: detected dubious ownership in repository at '/opt/homebrew/Library/Taps/homebrew/homebrew-services'
To add an exception for this directory, call:

	git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-services
mokin.li@MoKinLiMacBook-Pro homebrew-services % git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-services

mokin.li@MoKinLiMacBook-Pro homebrew-services % git remote -v
origin	https://gitee.com/cunkai/homebrew-services.git (fetch)
origin	https://gitee.com/cunkai/homebrew-services.git (push)

通过这种方式成功解决了问题:

mokin.li@MoKinLiMacBook-Pro ~ % ./BrewToolsDaily.sh                   
 ****** First, We require brew version. [brew -v] ****** 
Homebrew 3.6.20
Homebrew/homebrew-core (git revision 69deebcfe1d; last commit 2023-01-22)
Homebrew/homebrew-cask (git revision 201da9195e; last commit 2023-01-22)


 ****** Second, We should find the update. [brew update] ****** 
Already up-to-date.
 ****** Third, We should find the package update. [brew upgrade] ****** 

标签:origin,git,remote,update,services,homebrew
From: https://www.cnblogs.com/MoKinLi/p/17064734.html

相关文章