ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Mac开发使用相关

2021-12-15 15:59:10  阅读:224  来源: 互联网

标签:origin git Mac 开发 https homebrew brew 相关 com


文|Seraph

01 | brew

一、 替换/还原brew相关仓库
  1. 替换 / 还原 brew.git 仓库地址
cd "$(brew --repo)"
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git  #阿里仓库地址
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git #中科大
git remote set-url origin https://github.com/Homebrew/brew.git  #原仓库地址
  1. 替换 / 还原 homebrew-core.git 仓库地址
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git #阿里
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git  #中科大
git remote set-url origin https://github.com/Homebrew/homebrew-core.git

  1. 替换 / 还原 homebrew-bottles 访问地址
# bash终端
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profile #阿里 
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile  #中科大
source ~/.bash_profile
二、brew问题解决
  1. brew install过程中提示Error: Permission denied @ apply2files - /usr/local/lib/docker/cli-plugins
    解决:输入sudo chown -R $(whoami) $(brew --prefix)/*

  2. 安装homebrew时报错:

==> Downloading and installing Homebrew...
HEAD is now at 7fd508580 Merge pull request #12564 from Homebrew/dependabot/bundler/Library/Homebrew/sorbet-0.5.9452
error: Not a valid ref: refs/remotes/origin/master
fatal: ambiguous argument 'refs/remotes/origin/master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

解决:先卸载homebrew,再重新安装。

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

02 | Xcode

一、xcodebuild
  1. 报错:xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Deve
    解决:使用sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/命令切换到xcode环境下。

标签:origin,git,Mac,开发,https,homebrew,brew,相关,com
来源: https://blog.csdn.net/pengshuyes/article/details/104714475

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有