升级到BigSur无法使用git和brew解决办法
生活随笔
收集整理的這篇文章主要介紹了
升级到BigSur无法使用git和brew解决办法
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
Macbook 一直都沒有升級,剛升級到BigSur,從High Sur升級到Big Sur, 結(jié)果brew 命令無法使用了。
問題
$ brew update Error: homebrew-core is a shallow clone. To `brew update`, first run:git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow This command may take a few minutes to run due to the large size of the repository. This restriction has been made on GitHub's request because updating shallow clones is an extremely expensive operation due to the tree layout and traffic of Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you automatically to avoid repeatedly performing an expensive unshallow operation in CI systems (which should instead be fixed to not use shallow clones). Sorry for the inconvenience!按照提示,執(zhí)行 git ,結(jié)果也失敗了
DaviddeMacBook-Pro:~ david$ git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun DaviddeMacBook-Pro:~ david$ git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun DaviddeMacBook-Pro:~ david$ git config --list xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun DaviddeMacBook-Pro:~ david$ git xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun DaviddeMacBook-Pro:~ david$ git xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun....修復(fù)git命令
使用git命令:
$ gitYou have not agreed to the Xcode license agreements. You must agree to both license agreements below in order to use Xcode.Press the 'return' key to view the license agreements at '/Applications/Xcode.app/Contents/Resources/English.lproj/License.rtf'Xcode and Apple SDKs AgreementPLEASE SCROLL DOWN AND READ ALL OF THE FOLLOWING TERMS AND CONDITIONS CAREFULLY BEFORE USING THE APPLE SOFTWARE OR APPLE SERVICES. THIS IS A LEGAL AGREEMENT BETWEEN YOU AND APPLE. IF YOU AGREE TO BE BOUND BY ALL OF THE TERMS AND CONDITIONS, CLICK THE “AGREE” BUTTON. BY CLICKING “AGREE” OR BY DOWNLOADING, USING OR COPYING ANY PART OF THIS APPLE SOFTWARE OR USING ANY PART OF THE APPLE SERVICES, YOU ARE AGREEING ON YOUR OWN BEHALF AND/OR ON BEHALF OF YOUR COMPANY OR ORGANIZATION TO THE TERMS AND CONDITIONS STATED BELOW. IF YOU DO NOT OR CANNOT AGREE TO THE TERMS OF THIS AGREEMENT, YOU CANNOT USE THIS APPLE SOFTWARE OR THE APPLE SERVICES. DO NOT DOWNLOAD OR USE THIS APPLE SOFTWARE OR APPLE SERVICES IN THAT CASE........8.7 Entire Agreement; Governing Language This Agreement constitutes the entire agreement between the parties with respect to the use of the Apple Software and Apple Services licensed hereunder and supersedes all prior understandings regarding such subject matter. Notwithstanding the foregoing, to the extent that You have entered into the Apple Developer Program License Agreement (PLA) with Apple and are validly licensed by Apple to exercise additional rights, or to use additional features or functionality of the Apple Software or Apple Services under the PLA, You acknowledge and agree that the PLA shall govern Your use of such additional rights and privileges. No amendment to or modification of this Agreement will be binding unless in writing and signed by Apple. The parties hereto confirm that they have requested that this Agreement and all related documents be drafted in English. Les parties ont exigé que le présent contrat et tous les documents connexes soient rédigés en anglais. EA1647 8/7/2019Agreeing to the Xcode/iOS license requires admin privileges, please run “sudo xcodebuild -license” and then retry this command.好吧,按照提示,執(zhí)行命令
$ sudo xcodebuild -licenseYou have not agreed to the Xcode license agreements. You must agree to both license agreements below in order to use Xcode.Press the 'return' key to view the license agreements at '/Applications/Xcode.app/Contents/Resources/English.lproj/License.rtf'Xcode and Apple SDKs Agreement....By typing 'agree' you are agreeing to the terms of the software license agreements. Type 'print' to print them or anything else to cancel, [agree, print, cancel]按照提示,輸入agree.
然后git 命令可用了。
修復(fù)homebrew
現(xiàn)在可用更新brew了:
DaviddeMacBook-Pro:~ david$ cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/ DaviddeMacBook-Pro:homebrew-core david$ ls Aliases Formula audit_exceptions pypi_formula_mappings.json CODEOWNERS LICENSE.txt cmd style_exceptions CONTRIBUTING.md README.md formula_renames.json tap_migrations.jsonDaviddeMacBook-Pro:homebrew-core david$ git status On branch master Your branch is up to date with 'origin/master'.nothing to commit, working tree cleanDaviddeMacBook-Pro:homebrew-core david$ git pull然后就可用了。
總結(jié)
以上是生活随笔為你收集整理的升级到BigSur无法使用git和brew解决办法的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 记录sqlserver中使用变量
- 下一篇: 工信部终于出手!整治APP广告“乱跳转”